mirror of
https://github.com/jmarshall23/Quake_4_Alpha.git
synced 2026-08-15 15:50:52 +02:00
Added missing cmake file.
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
@echo off
|
||||
start quake4 +set fs_game q4xbase
|
||||
start q4xp +set fs_game q4xbase
|
||||
@@ -17,6 +17,7 @@ set(CMAKE_CXX_EXTENSIONS ON)
|
||||
option(Q4_BUILD_IDLIB "Build the Quake 4 SDK idlib seed" ON)
|
||||
option(Q4_BUILD_ENGINE_SEED "Compile the PDB-proven Doom engine seed" ON)
|
||||
option(Q4_BUILD_GAME_DLL "Build the Quake 4 single-player game DLL" ON)
|
||||
option(Q4_BUILD_TOOLS_DLL "Build the reconstructed Quake 4 tools DLL" ON)
|
||||
option(Q4_BUILD_RECON_TOOLS "Build reconstruction inventory tools" ON)
|
||||
|
||||
if(MSVC)
|
||||
@@ -39,6 +40,10 @@ if(Q4_BUILD_GAME_DLL)
|
||||
add_subdirectory(game)
|
||||
endif()
|
||||
|
||||
if(Q4_BUILD_TOOLS_DLL)
|
||||
add_subdirectory(tools)
|
||||
endif()
|
||||
|
||||
if(Q4_BUILD_RECON_TOOLS)
|
||||
add_subdirectory(tools/reconstruction)
|
||||
endif()
|
||||
|
||||
@@ -26,7 +26,7 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
#define __AASBUILD_LOCAL_H__
|
||||
|
||||
#include "AASFile.h"
|
||||
#include "AASFile_local.h"
|
||||
#include "AASCompilerFile.h"
|
||||
|
||||
#include "Brush.h"
|
||||
#include "BrushBSP.h"
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
|
||||
private:
|
||||
const idAASSettings * aasSettings;
|
||||
idAASFileLocal * file;
|
||||
idAASCompilerFile * file;
|
||||
aasProcNode_t * procNodes;
|
||||
int numProcNodes;
|
||||
int numGravitationalSubdivisions;
|
||||
@@ -137,7 +137,7 @@ private: // storing file
|
||||
bool GetAreaForLeafNode( idBrushBSPNode *node, int *areaNum );
|
||||
int StoreTree_r( idBrushBSPNode *node );
|
||||
void GetSizeEstimate_r( idBrushBSPNode *parent, idBrushBSPNode *node, struct sizeEstimate_s &size );
|
||||
void SetSizeEstimate( const idBrushBSP &bsp, idAASFileLocal *file );
|
||||
void SetSizeEstimate( const idBrushBSP &bsp, idAASCompilerFile *file );
|
||||
bool StoreFile( const idBrushBSP &bsp );
|
||||
|
||||
};
|
||||
|
||||
@@ -25,6 +25,8 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
#ifndef __AASCLUSTER_H__
|
||||
#define __AASCLUSTER_H__
|
||||
|
||||
#include "AASCompilerFile.h"
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
@@ -36,11 +38,11 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
class idAASCluster {
|
||||
|
||||
public:
|
||||
bool Build( idAASFileLocal *file );
|
||||
bool BuildSingleCluster( idAASFileLocal *file );
|
||||
bool Build( idAASCompilerFile *file );
|
||||
bool BuildSingleCluster( idAASCompilerFile *file );
|
||||
|
||||
private:
|
||||
idAASFileLocal * file;
|
||||
idAASCompilerFile * file;
|
||||
bool noFaceFlood;
|
||||
|
||||
private:
|
||||
|
||||
+42
-2
@@ -44,6 +44,9 @@ signatures; the retail Hex-Rays listing supplies the non-trivial behavior.
|
||||
#include "AASFile.h"
|
||||
#include "AASFile_local.h"
|
||||
|
||||
idAASFileLocal AASFileLocal;
|
||||
idAASFile *AASFile = &AASFileLocal;
|
||||
|
||||
static bool Reachability_Write( idFile *file, const idReachability *reach ) {
|
||||
file->WriteFloatString( "\t\t%d %d (%f %f %f) (%f %f %f) %d %d",
|
||||
reach->travelType, reach->toAreaNum,
|
||||
@@ -107,7 +110,7 @@ idAASSettings::idAASSettings() {
|
||||
boundingBoxes[0] = idBounds( idVec3( -16, -16, 0 ), idVec3( 16, 16, 72 ) );
|
||||
usePatches = writeBrushMap = playerFlood = noOptimize = false;
|
||||
allowSwimReachabilities = allowFlyReachabilities = false;
|
||||
generateAllFaces = generateTacticalFeatures = false;
|
||||
generateTacticalFeatures = false;
|
||||
iAASOnly = 0;
|
||||
fileExtension = "aas48";
|
||||
gravity.Set( 0, 0, -1066 );
|
||||
@@ -208,7 +211,6 @@ bool idAASSettings::FromParser( Lexer &src ) {
|
||||
else if ( token == "noOptimize" ) { if ( !ParseBool( src, noOptimize ) ) return false; }
|
||||
else if ( token == "allowSwimReachabilities" ) { if ( !ParseBool( src, allowSwimReachabilities ) ) return false; }
|
||||
else if ( token == "allowFlyReachabilities" ) { if ( !ParseBool( src, allowFlyReachabilities ) ) return false; }
|
||||
else if ( token == "generateAllFaces" ) { if ( !ParseBool( src, generateAllFaces ) ) return false; }
|
||||
else if ( token == "generateTacticalFeatures" ) { if ( !ParseBool( src, generateTacticalFeatures ) ) return false; }
|
||||
else if ( token == "iAASOnly" ) { if ( !ParseInt( src, iAASOnly ) ) return false; }
|
||||
else if ( token == "fileExtension" ) { if ( !src.ExpectTokenString( "=" ) || !src.ReadToken( &token ) ) return false; fileExtension = token; }
|
||||
@@ -837,10 +839,48 @@ void idAASFileLocal::LinkReversedReachability() {
|
||||
}
|
||||
|
||||
void idAASFileLocal::FinishAreas() {
|
||||
// Quake 4 stores the usable ceiling height in every AAS area. The Doom 3
|
||||
// baseline only calculated center and bounds, which leaves the Raven field
|
||||
// uninitialized and breaks tactical cover queries in the game DLL.
|
||||
if ( areas.Num() < 2 ) {
|
||||
for ( int i = 0; i < areas.Num(); i++ ) {
|
||||
areas[i].center.Zero();
|
||||
areas[i].bounds.Clear();
|
||||
areas[i].ceiling = 0.0f;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < areas.Num(); i++ ) {
|
||||
areas[i].center = AreaReachableGoal( i );
|
||||
areas[i].bounds = AreaBounds( i );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < areas.Num(); i++ ) {
|
||||
if ( areas[i].flags & AREA_FLOOR ) {
|
||||
int traceAreas[10];
|
||||
idVec3 tracePoints[10];
|
||||
aasTrace_t trace;
|
||||
trace.maxAreas = 10;
|
||||
trace.areas = traceAreas;
|
||||
trace.points = tracePoints;
|
||||
|
||||
idVec3 end = areas[i].center;
|
||||
end.z += 500.0f;
|
||||
Trace( trace, areas[i].center, end );
|
||||
|
||||
areas[i].ceiling = trace.endpos.z;
|
||||
for ( int j = 0; j < trace.numAreas; j++ ) {
|
||||
if ( traceAreas[j] != i ) {
|
||||
areas[i].ceiling = tracePoints[j].z;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
idVec3 point( 0.0f, 0.0f, 131072.0f );
|
||||
PushPointIntoAreaNum( i, point );
|
||||
areas[i].ceiling = point.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int idAASFileLocal::NumReachabilities() const {
|
||||
|
||||
@@ -281,8 +281,6 @@ public:
|
||||
bool allowSwimReachabilities;
|
||||
bool allowFlyReachabilities;
|
||||
// RAVEN BEGIN
|
||||
// bkreimeier
|
||||
bool generateAllFaces;
|
||||
// cdr: AASTactical
|
||||
bool generateTacticalFeatures;
|
||||
// scork: AASOnly numbers
|
||||
|
||||
+5
-3
@@ -25,6 +25,8 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
#ifndef __AASREACH_H__
|
||||
#define __AASREACH_H__
|
||||
|
||||
#include "AASCompilerFile.h"
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
@@ -36,17 +38,17 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
class idAASReach {
|
||||
|
||||
public:
|
||||
bool Build( const idMapFile *mapFile, idAASFileLocal *file );
|
||||
bool Build( const idMapFile *mapFile, idAASCompilerFile *file );
|
||||
|
||||
private:
|
||||
const idMapFile * mapFile;
|
||||
idAASFileLocal * file;
|
||||
idAASCompilerFile * file;
|
||||
int numReachabilities;
|
||||
bool allowSwimReachabilities;
|
||||
bool allowFlyReachabilities;
|
||||
|
||||
private: // reachability
|
||||
void FlagReachableAreas( idAASFileLocal *file );
|
||||
void FlagReachableAreas( idAASCompilerFile *file );
|
||||
bool ReachabilityExists( int fromAreaNum, int toAreaNum );
|
||||
bool CanSwimInArea( int areaNum );
|
||||
bool AreaHasFloor( int areaNum );
|
||||
|
||||
@@ -29,6 +29,20 @@ file(GLOB_RECURSE Q4_AAS_SOURCES CONFIGURE_DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/aas/*.cpp
|
||||
)
|
||||
set(Q4_AAS_FILE_SOURCE ${PROJECT_SOURCE_DIR}/aas/AASFile.cpp)
|
||||
set(Q4_AAS_COMPILER_SOURCES
|
||||
${PROJECT_SOURCE_DIR}/aas/AASSettingsTools.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASTactical.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASBuild.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASBuild_file.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASBuild_gravity.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASBuild_ledge.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASBuild_merge.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASCluster.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/AASReach.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/Brush.cpp
|
||||
${PROJECT_SOURCE_DIR}/aas/BrushBSP.cpp
|
||||
)
|
||||
list(REMOVE_ITEM Q4_AAS_SOURCES ${Q4_AAS_COMPILER_SOURCES})
|
||||
|
||||
file(GLOB_RECURSE Q4_CM_SOURCES CONFIGURE_DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/cm/*.cpp
|
||||
@@ -356,13 +370,15 @@ set_target_properties(q4_reconstruction_foundation PROPERTIES FOLDER "Reconstruc
|
||||
# Full reconstructed Win32 engine integration target. The per-compiland
|
||||
# object targets above remain the source-ownership/ABI audit surface; this
|
||||
# target compiles the same recovered sources into a runnable executable.
|
||||
# Editor/dmap tool exports and CURL are intentionally disabled until their
|
||||
# engine-facing interfaces have been reconstructed from the retail PDB.
|
||||
# The editor and compilers live in the external q4_tools target and cross the
|
||||
# reconstructed retail Tools API rather than being compiled into the engine.
|
||||
# CURL remains disabled at this reconstruction frontier.
|
||||
set(Q4_OPENAL_LOADER_SOURCES
|
||||
${PROJECT_SOURCE_DIR}/openal/idal.cpp
|
||||
)
|
||||
|
||||
add_executable(q4xp WIN32
|
||||
${PROJECT_SOURCE_DIR}/sys/win32/rc/Quake4.rc
|
||||
${Q4_AAS_SOURCES}
|
||||
${Q4_CM_MODEL_SOURCE}
|
||||
${Q4_CM_SOURCES}
|
||||
|
||||
+166
-54
@@ -27,6 +27,12 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
|
||||
#include "../renderer/Image.h"
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#include "../sys/win32/win_local.h"
|
||||
#endif
|
||||
|
||||
#include "../tools/ToolsStub.inl"
|
||||
|
||||
#define MAX_PRINT_MSG_SIZE 4096
|
||||
#define MAX_WARNING_LIST 256
|
||||
|
||||
@@ -105,6 +111,9 @@ idGame * game = NULL;
|
||||
idGameEdit * gameEdit = NULL;
|
||||
#endif
|
||||
|
||||
rvToolsStub toolsStub;
|
||||
rvTools * tools = &toolsStub;
|
||||
|
||||
// writes si_version to the config file - in a kinda obfuscated way
|
||||
//#define ID_WRITE_VERSION
|
||||
|
||||
@@ -217,6 +226,7 @@ private:
|
||||
idStrList errorList;
|
||||
|
||||
int gameDLL;
|
||||
int toolsDLL;
|
||||
int desiredMachineSpec;
|
||||
bool com_renderableGameFrame;
|
||||
|
||||
@@ -269,6 +279,7 @@ idCommonLocal::idCommonLocal( void ) {
|
||||
rd_rcon = false;
|
||||
|
||||
gameDLL = 0;
|
||||
toolsDLL = 0;
|
||||
desiredMachineSpec = -1;
|
||||
com_renderableGameFrame = true;
|
||||
|
||||
@@ -306,29 +317,111 @@ bool idCommonLocal::IsToolActive( void ) const {
|
||||
}
|
||||
|
||||
rvISourceControl *idCommonLocal::GetSourceControl( void ) {
|
||||
return NULL;
|
||||
return tools->GetSourceControl();
|
||||
}
|
||||
|
||||
void idCommonLocal::ModViewThink( void ) {
|
||||
tools->ModViewRun();
|
||||
}
|
||||
|
||||
void idCommonLocal::RunAlwaysThinkGUIs( int time ) {
|
||||
uiManager->RunAlwaysThinkGUIs( time );
|
||||
}
|
||||
|
||||
void idCommonLocal::DebuggerCheckBreakpoint( idInterpreter *interpreter, idProgram *program, int instructionPointer ) {
|
||||
tools->DebuggerCheckBreakpoint( interpreter, program, instructionPointer );
|
||||
}
|
||||
|
||||
bool idCommonLocal::DoingDeclValidation( void ) {
|
||||
return false;
|
||||
return tools->IsToolActive( EDITOR_DECL_VALIDATING ) == EDITOR_DECL_VALIDATING;
|
||||
}
|
||||
|
||||
void idCommonLocal::SetCrashReportAutoSendString( const char *string ) {
|
||||
}
|
||||
|
||||
void idCommonLocal::LoadToolsDLL( void ) {
|
||||
if ( toolsDLL != 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
char dllPath[ MAX_OSPATH ];
|
||||
fileSystem->FindDLL( "ToolsReconstructed", dllPath, true );
|
||||
if ( dllPath[ 0 ] == '\0' ) {
|
||||
Warning( "couldn't find tools dynamic library" );
|
||||
return;
|
||||
}
|
||||
|
||||
DPrintf( "Loading tools DLL: '%s'\n", dllPath );
|
||||
toolsDLL = sys->DLL_Load( dllPath );
|
||||
if ( toolsDLL == 0 ) {
|
||||
Warning( "couldn't load tools dynamic library" );
|
||||
return;
|
||||
}
|
||||
|
||||
GetToolsAPI_t GetToolsAPI = reinterpret_cast<GetToolsAPI_t>(
|
||||
sys->DLL_GetProcAddress( toolsDLL, "GetToolsAPI" ) );
|
||||
if ( GetToolsAPI == NULL ) {
|
||||
sys->DLL_Unload( toolsDLL );
|
||||
toolsDLL = 0;
|
||||
Warning( "couldn't find tools DLL API" );
|
||||
return;
|
||||
}
|
||||
|
||||
toolsImport_t imports;
|
||||
memset( &imports, 0, sizeof( imports ) );
|
||||
imports.version = TOOLS_API_VERSION;
|
||||
imports.instance = toolsDLL;
|
||||
#if defined( _WIN32 )
|
||||
imports.ownerWnd = win32.hWnd;
|
||||
imports.ownerDC = win32.hDC;
|
||||
imports.hGLRC = win32.hGLRC;
|
||||
imports.pfd = &win32.pfd;
|
||||
#endif
|
||||
imports.sys = ::sys;
|
||||
imports.common = ::common;
|
||||
imports.cmdSystem = ::cmdSystem;
|
||||
imports.cvarSystem = ::cvarSystem;
|
||||
imports.fileSystem = ::fileSystem;
|
||||
imports.renderSystem = ::renderSystem;
|
||||
imports.soundSystem = ::soundSystem;
|
||||
imports.renderModelManager = ::renderModelManager;
|
||||
imports.uiManager = ::uiManager;
|
||||
imports.declManager = ::declManager;
|
||||
imports.AASFile = ::AASFile;
|
||||
imports.collisionModelManager = ::collisionModelManager;
|
||||
imports.gameEdit = ::gameEdit;
|
||||
imports.materialEdit = ::materialEdit;
|
||||
imports.soundShaderEdit = ::soundShaderEdit;
|
||||
imports.declAFEdit = NULL;
|
||||
imports.declPlaybackEdit = ::declPlaybackEdit;
|
||||
imports.declEffectEdit = ::declEffectEdit;
|
||||
imports.declLipSyncEdit = ::declLipSyncEdit;
|
||||
imports.windowEdit = NULL;
|
||||
imports.varEdit = NULL;
|
||||
imports.session = ::session;
|
||||
imports.globalImages = ::globalImages;
|
||||
imports.console = ::console;
|
||||
|
||||
toolsExport_t *exports = GetToolsAPI(
|
||||
&imports, Memory::Allocate, Memory::Free, Memory::MSize );
|
||||
if ( exports == NULL || exports->version != TOOLS_API_VERSION || exports->tools == NULL ) {
|
||||
sys->DLL_Unload( toolsDLL );
|
||||
toolsDLL = 0;
|
||||
tools = &toolsStub;
|
||||
Warning( "wrong tools DLL API version" );
|
||||
return;
|
||||
}
|
||||
|
||||
tools = exports->tools;
|
||||
}
|
||||
|
||||
void idCommonLocal::UnloadToolsDLL( void ) {
|
||||
tools->Shutdown();
|
||||
if ( toolsDLL != 0 ) {
|
||||
sys->DLL_Unload( toolsDLL );
|
||||
toolsDLL = 0;
|
||||
}
|
||||
tools = &toolsStub;
|
||||
com_editors = 0;
|
||||
com_editorActive = false;
|
||||
}
|
||||
@@ -895,12 +988,10 @@ idCommonLocal::Quit
|
||||
*/
|
||||
void idCommonLocal::Quit( void ) {
|
||||
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
if ( com_editors & EDITOR_RADIANT ) {
|
||||
RadiantInit();
|
||||
if ( tools->IsToolActive( EDITOR_RADIANT ) ) {
|
||||
tools->InitTool( EDITOR_RADIANT, NULL );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// don't try to shutdown if we are in a recursive error
|
||||
if ( !com_errorEntered ) {
|
||||
@@ -1105,17 +1196,17 @@ idCommonLocal::InitTool
|
||||
=================
|
||||
*/
|
||||
void idCommonLocal::InitTool( const int tool, const idDict *dict ) {
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
if ( tool & EDITOR_SOUND ) {
|
||||
SoundEditorInit( dict );
|
||||
} else if ( tool & EDITOR_LIGHT ) {
|
||||
LightEditorInit( dict );
|
||||
} else if ( tool & EDITOR_PARTICLE ) {
|
||||
ParticleEditorInit( dict );
|
||||
} else if ( tool & EDITOR_AF ) {
|
||||
AFEditorInit( dict );
|
||||
if ( cvarSystem->GetCVarBool( "r_fullscreen" ) ) {
|
||||
cvarSystem->SetCVarBool( "r_fullscreen", false );
|
||||
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart\n" );
|
||||
}
|
||||
|
||||
LoadToolsDLL();
|
||||
if ( toolsDLL != 0 ) {
|
||||
idKeyInput::ClearStates();
|
||||
com_editors |= tool;
|
||||
tools->InitTool( tool, dict );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1257,7 +1348,6 @@ int idCommonLocal::KeyState( int key ) {
|
||||
|
||||
//============================================================================
|
||||
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
/*
|
||||
==================
|
||||
Com_Editor_f
|
||||
@@ -1266,7 +1356,7 @@ Com_Editor_f
|
||||
==================
|
||||
*/
|
||||
static void Com_Editor_f( const idCmdArgs &args ) {
|
||||
RadiantInit();
|
||||
common->InitTool( EDITOR_RADIANT, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1275,11 +1365,7 @@ Com_ScriptDebugger_f
|
||||
=============
|
||||
*/
|
||||
static void Com_ScriptDebugger_f( const idCmdArgs &args ) {
|
||||
// Make sure it wasnt on the command line
|
||||
if ( !( com_editors & EDITOR_DEBUGGER ) ) {
|
||||
common->Printf( "Script debugger is currently disabled\n" );
|
||||
// DebuggerClientLaunch();
|
||||
}
|
||||
common->InitTool( EDITOR_DEBUGGER, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1288,7 +1374,7 @@ Com_EditGUIs_f
|
||||
=============
|
||||
*/
|
||||
static void Com_EditGUIs_f( const idCmdArgs &args ) {
|
||||
GUIEditorInit();
|
||||
common->InitTool( EDITOR_GUI, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1299,9 +1385,48 @@ Com_MaterialEditor_f
|
||||
static void Com_MaterialEditor_f( const idCmdArgs &args ) {
|
||||
// Turn off sounds
|
||||
soundSystem->SetMute( true );
|
||||
MaterialEditorInit();
|
||||
common->InitTool( EDITOR_MATERIAL, NULL );
|
||||
}
|
||||
|
||||
static void Com_Dmap_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->Dmap( args );
|
||||
}
|
||||
|
||||
static void Com_RenderBump_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->Renderbump( args );
|
||||
}
|
||||
|
||||
static void Com_RenderBumpFlat_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->RenderbumpFlat( args );
|
||||
}
|
||||
|
||||
static void Com_RunAAS_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->RunAAS( args );
|
||||
}
|
||||
|
||||
static void Com_RunAASDir_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->RunAASDir( args );
|
||||
}
|
||||
|
||||
static void Com_RunReach_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->RunReach( args );
|
||||
}
|
||||
|
||||
static void Com_RunAASTactical_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->RunAASTactical( args );
|
||||
}
|
||||
|
||||
static void Com_RoQ_f( const idCmdArgs &args ) {
|
||||
common->LoadToolsDLL();
|
||||
tools->RoQFileEncode( args );
|
||||
}
|
||||
#endif // ID_ALLOW_TOOLS
|
||||
|
||||
/*
|
||||
============
|
||||
@@ -1342,14 +1467,13 @@ static void PrintMemInfo_f( const idCmdArgs &args ) {
|
||||
fileSystem->CloseFile( f );
|
||||
}
|
||||
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
/*
|
||||
==================
|
||||
Com_EditLights_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditLights_f( const idCmdArgs &args ) {
|
||||
LightEditorInit( NULL );
|
||||
common->InitTool( EDITOR_LIGHT, NULL );
|
||||
cvarSystem->SetCVarInteger( "g_editEntityMode", 1 );
|
||||
}
|
||||
|
||||
@@ -1359,7 +1483,7 @@ Com_EditSounds_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditSounds_f( const idCmdArgs &args ) {
|
||||
SoundEditorInit( NULL );
|
||||
common->InitTool( EDITOR_SOUND, NULL );
|
||||
cvarSystem->SetCVarInteger( "g_editEntityMode", 2 );
|
||||
}
|
||||
|
||||
@@ -1369,7 +1493,7 @@ Com_EditDecls_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditDecls_f( const idCmdArgs &args ) {
|
||||
DeclBrowserInit( NULL );
|
||||
common->InitTool( EDITOR_DECL, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1378,16 +1502,7 @@ Com_EditAFs_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditAFs_f( const idCmdArgs &args ) {
|
||||
AFEditorInit( NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Com_EditParticles_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditParticles_f( const idCmdArgs &args ) {
|
||||
ParticleEditorInit( NULL );
|
||||
common->InitTool( EDITOR_AF, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1396,7 +1511,7 @@ Com_EditScripts_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditScripts_f( const idCmdArgs &args ) {
|
||||
ScriptEditorInit( NULL );
|
||||
common->InitTool( EDITOR_SCRIPT, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1405,9 +1520,8 @@ Com_EditPDAs_f
|
||||
==================
|
||||
*/
|
||||
static void Com_EditPDAs_f( const idCmdArgs &args ) {
|
||||
PDAEditorInit( NULL );
|
||||
common->InitTool( EDITOR_PDA, NULL );
|
||||
}
|
||||
#endif // ID_ALLOW_TOOLS
|
||||
|
||||
/*
|
||||
==================
|
||||
@@ -2480,25 +2594,23 @@ void idCommonLocal::InitCommands( void ) {
|
||||
cmdSystem->AddCommand( "setMachineSpec", Com_SetMachineSpec_f, CMD_FL_SYSTEM, "detects system capabilities and sets com_machineSpec to appropriate value" );
|
||||
cmdSystem->AddCommand( "execMachineSpec", Com_ExecMachineSpec_f, CMD_FL_SYSTEM, "execs the appropriate config files and sets cvars based on com_machineSpec" );
|
||||
|
||||
#if !defined( ID_DEMO_BUILD ) && !defined( ID_DEDICATED ) && !defined( Q4_DISABLE_TOOLS )
|
||||
#if !defined( ID_DEMO_BUILD ) && !defined( ID_DEDICATED )
|
||||
// compilers
|
||||
cmdSystem->AddCommand( "dmap", Dmap_f, CMD_FL_TOOL, "compiles a map", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "renderbump", RenderBump_f, CMD_FL_TOOL, "renders a bump map", idCmdSystem::ArgCompletion_ModelName );
|
||||
cmdSystem->AddCommand( "renderbumpFlat", RenderBumpFlat_f, CMD_FL_TOOL, "renders a flat bump map", idCmdSystem::ArgCompletion_ModelName );
|
||||
cmdSystem->AddCommand( "runAAS", RunAAS_f, CMD_FL_TOOL, "compiles an AAS file for a map", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "runAASDir", RunAASDir_f, CMD_FL_TOOL, "compiles AAS files for all maps in a folder", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "runReach", RunReach_f, CMD_FL_TOOL, "calculates reachability for an AAS file", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "roq", RoQFileEncode_f, CMD_FL_TOOL, "encodes a roq file" );
|
||||
#endif
|
||||
cmdSystem->AddCommand( "dmap", Com_Dmap_f, CMD_FL_TOOL, "compiles a map", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "renderbump", Com_RenderBump_f, CMD_FL_TOOL, "renders a bump map", idCmdSystem::ArgCompletion_ModelName );
|
||||
cmdSystem->AddCommand( "renderbumpFlat", Com_RenderBumpFlat_f, CMD_FL_TOOL, "renders a flat bump map", idCmdSystem::ArgCompletion_ModelName );
|
||||
cmdSystem->AddCommand( "runAAS", Com_RunAAS_f, CMD_FL_TOOL, "compiles an AAS file for a map", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "runAASDir", Com_RunAASDir_f, CMD_FL_TOOL, "compiles AAS files for all maps in a folder", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "runReach", Com_RunReach_f, CMD_FL_TOOL, "calculates reachability for an AAS file", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "runAASTactical", Com_RunAASTactical_f, CMD_FL_TOOL, "generates Quake 4 tactical AAS features", idCmdSystem::ArgCompletion_MapName );
|
||||
cmdSystem->AddCommand( "roq", Com_RoQ_f, CMD_FL_TOOL, "encodes a roq file" );
|
||||
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
// editors
|
||||
cmdSystem->AddCommand( "editor", Com_Editor_f, CMD_FL_TOOL, "launches the level editor Radiant" );
|
||||
cmdSystem->AddCommand( "editLights", Com_EditLights_f, CMD_FL_TOOL, "launches the in-game Light Editor" );
|
||||
cmdSystem->AddCommand( "editSounds", Com_EditSounds_f, CMD_FL_TOOL, "launches the in-game Sound Editor" );
|
||||
cmdSystem->AddCommand( "editDecls", Com_EditDecls_f, CMD_FL_TOOL, "launches the in-game Declaration Editor" );
|
||||
cmdSystem->AddCommand( "editAFs", Com_EditAFs_f, CMD_FL_TOOL, "launches the in-game Articulated Figure Editor" );
|
||||
cmdSystem->AddCommand( "editParticles", Com_EditParticles_f, CMD_FL_TOOL, "launches the in-game Particle Editor" );
|
||||
cmdSystem->AddCommand( "editScripts", Com_EditScripts_f, CMD_FL_TOOL, "launches the in-game Script Editor" );
|
||||
cmdSystem->AddCommand( "editGUIs", Com_EditGUIs_f, CMD_FL_TOOL, "launches the GUI Editor" );
|
||||
cmdSystem->AddCommand( "editPDAs", Com_EditPDAs_f, CMD_FL_TOOL, "launches the in-game PDA Editor" );
|
||||
|
||||
@@ -124,6 +124,8 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
|
||||
// editor info
|
||||
#define EDITOR_WINDOWTEXT "QuakeEdit"
|
||||
#define EDITOR_REGISTRY_KEY "Raven Software\\Quake4\\Tools\\Radiant"
|
||||
#define EDITOR_DEFAULT_PROJECT "quake4.qe4"
|
||||
|
||||
// win32 info
|
||||
#define WIN32_CONSOLE_CLASS "Quake 4 WinConsole"
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
file(GLOB_RECURSE Q4_GAME_SOURCES CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
|
||||
)
|
||||
|
||||
# Callbacks.cpp is generated-style source text included by gamesys/Class.cpp;
|
||||
# it is not a standalone translation unit in the Quake 4 SDK project.
|
||||
list(REMOVE_ITEM Q4_GAME_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gamesys/Callbacks.cpp
|
||||
)
|
||||
|
||||
add_library(gamex86 SHARED
|
||||
${Q4_GAME_SOURCES}
|
||||
${PROJECT_SOURCE_DIR}/framework/DeclPlayerModel.cpp
|
||||
)
|
||||
|
||||
target_include_directories(gamex86 PRIVATE
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/game
|
||||
"C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include"
|
||||
)
|
||||
|
||||
target_compile_definitions(gamex86 PRIVATE
|
||||
WIN32
|
||||
_WINDOWS
|
||||
_LOAD_DLL
|
||||
_USE_32BIT_TIME_T
|
||||
GAME_DLL
|
||||
Q4SDK
|
||||
Q4_RECON_RETAIL_UI_MANAGER_ABI
|
||||
Q4_NO_PUNKBUSTER
|
||||
$<$<CONFIG:Debug>:_DEBUG>
|
||||
$<$<CONFIG:Release>:NDEBUG;_FINAL>
|
||||
)
|
||||
|
||||
target_link_libraries(gamex86 PRIVATE q4_game_idlib winmm)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(gamex86 PRIVATE /Zi)
|
||||
target_link_options(gamex86 PRIVATE
|
||||
/DEF:${CMAKE_CURRENT_SOURCE_DIR}/game.def
|
||||
/DEBUG:FULL
|
||||
/PDB:E:/projects/Quake4Alpha/q4base/gamex86.pdb
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(gamex86 PROPERTIES
|
||||
OUTPUT_NAME gamex86
|
||||
PREFIX ""
|
||||
RUNTIME_OUTPUT_DIRECTORY "E:/projects/Quake4Alpha/q4base"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "E:/projects/Quake4Alpha/q4base"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "E:/projects/Quake4Alpha/q4base"
|
||||
LIBRARY_OUTPUT_DIRECTORY "E:/projects/Quake4Alpha/q4base"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "E:/projects/Quake4Alpha/q4base"
|
||||
PDB_OUTPUT_DIRECTORY "E:/projects/Quake4Alpha/q4base"
|
||||
FOLDER "Game"
|
||||
)
|
||||
@@ -410,7 +410,7 @@ const float MAX_BOUND_SIZE = 65536.0f;
|
||||
#include "../framework/async/AsyncNetwork.h"
|
||||
|
||||
// RAVEN BEGIN
|
||||
#if !defined( Q4_RECON_SEED )
|
||||
#if !defined( Q4_RECON_SEED ) || defined( Q4_RECON_ENGINE_PRIVATE )
|
||||
#include "../tools/Tools.h"
|
||||
#endif
|
||||
// RAVEN END
|
||||
|
||||
@@ -26,6 +26,16 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
#pragma hdrstop
|
||||
|
||||
#include "tr_local.h"
|
||||
|
||||
class rvMaterialEditLocal : public rvMaterialEdit {
|
||||
public:
|
||||
virtual void SetGui( idMaterial *edit, const char *name ) { edit->SetGui( name ); }
|
||||
virtual int GetImageWidth( const idMaterial *edit ) const { return edit->GetImageWidth(); }
|
||||
virtual int GetImageHeight( const idMaterial *edit ) const { return edit->GetImageHeight(); }
|
||||
};
|
||||
|
||||
static rvMaterialEditLocal materialEditLocal;
|
||||
rvMaterialEdit *materialEdit = &materialEditLocal;
|
||||
#include "Shaders.h"
|
||||
|
||||
// Negative expression indexes identify renderer-provided GLSL constants to
|
||||
|
||||
@@ -359,6 +359,13 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
#define qglVertexPointer glVertexPointer
|
||||
#define qglViewport glViewport
|
||||
|
||||
#if defined( _WINDOWS )
|
||||
#define qwglMakeCurrent wglMakeCurrent
|
||||
#define qwglSwapBuffers SwapBuffers
|
||||
#define qwglUseFontBitmaps wglUseFontBitmapsA
|
||||
#define qwglUseFontOutlines wglUseFontOutlinesA
|
||||
#endif
|
||||
|
||||
#ifdef GLX_VERSION_1_1 // catch all for any GLX-aware situation
|
||||
#define qglXChooseVisual glXChooseVisual
|
||||
#define qglXCreateContext glXCreateContext
|
||||
|
||||
@@ -147,12 +147,33 @@ idRenderLightLocal::idRenderLightLocal() {
|
||||
}
|
||||
|
||||
void idRenderLightLocal::FreeRenderLight() {
|
||||
if ( world ) {
|
||||
world->FreeLightDef( index );
|
||||
} else {
|
||||
R_FreeLightDefDerivedData( this );
|
||||
}
|
||||
}
|
||||
void idRenderLightLocal::UpdateRenderLight( const renderLight_t *re, bool forceUpdate ) {
|
||||
if ( world ) {
|
||||
world->UpdateLightDef( index, re );
|
||||
return;
|
||||
}
|
||||
if ( forceUpdate || memcmp( &parms, re, sizeof( parms ) ) ) {
|
||||
R_FreeLightDefDerivedData( this );
|
||||
parms = *re;
|
||||
R_DeriveLightData( this );
|
||||
}
|
||||
}
|
||||
void idRenderLightLocal::GetRenderLight( renderLight_t *re ) {
|
||||
*re = parms;
|
||||
}
|
||||
void idRenderLightLocal::ForceUpdate() {
|
||||
if ( world ) {
|
||||
world->UpdateLightDef( index, &parms );
|
||||
} else {
|
||||
R_FreeLightDefDerivedData( this );
|
||||
R_DeriveLightData( this );
|
||||
}
|
||||
}
|
||||
int idRenderLightLocal::GetIndex() {
|
||||
return index;
|
||||
|
||||
@@ -43,6 +43,9 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
#define SOUNDWORLD_EDITOR 3
|
||||
#define SOUNDWORLD_MAX 4
|
||||
|
||||
const float DOOM_TO_METERS = 0.0254f;
|
||||
const float METERS_TO_DOOM = ( 1.0f / DOOM_TO_METERS );
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ along with Quake 4 Reconstructed Source Code. If not, see <http://www.gnu.org/l
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#define IDB_BITMAP_LOGO 4000
|
||||
#define IDI_ICON1 4001
|
||||
#define IDB_BITMAP_LOGO 4001
|
||||
#define IDI_ICON1 1024
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -772,7 +772,7 @@ void Sys_PumpEvents( void ) {
|
||||
}
|
||||
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
if ( GUIEditorHandleMessage ( &msg ) ) {
|
||||
if ( tools->HandleMessage( &msg ) ) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -1455,51 +1455,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
||||
// set exceptions, even if some crappy syscall changes them!
|
||||
Sys_FPU_EnableExceptions( TEST_FPU_EXCEPTIONS );
|
||||
|
||||
#ifdef ID_ALLOW_TOOLS
|
||||
if ( com_editors ) {
|
||||
if ( com_editors & EDITOR_GUI ) {
|
||||
// GUI editor
|
||||
GUIEditorRun();
|
||||
} else if ( com_editors & EDITOR_RADIANT ) {
|
||||
// Level Editor
|
||||
RadiantRun();
|
||||
}
|
||||
else if (com_editors & EDITOR_MATERIAL ) {
|
||||
//BSM Nerve: Add support for the material editor
|
||||
MaterialEditorRun();
|
||||
}
|
||||
else {
|
||||
if ( com_editors & EDITOR_LIGHT ) {
|
||||
// in-game Light Editor
|
||||
LightEditorRun();
|
||||
}
|
||||
if ( com_editors & EDITOR_SOUND ) {
|
||||
// in-game Sound Editor
|
||||
SoundEditorRun();
|
||||
}
|
||||
if ( com_editors & EDITOR_DECL ) {
|
||||
// in-game Declaration Browser
|
||||
DeclBrowserRun();
|
||||
}
|
||||
if ( com_editors & EDITOR_AF ) {
|
||||
// in-game Articulated Figure Editor
|
||||
AFEditorRun();
|
||||
}
|
||||
if ( com_editors & EDITOR_PARTICLE ) {
|
||||
// in-game Particle Editor
|
||||
ParticleEditorRun();
|
||||
}
|
||||
if ( com_editors & EDITOR_SCRIPT ) {
|
||||
// in-game Script Editor
|
||||
ScriptEditorRun();
|
||||
}
|
||||
if ( com_editors & EDITOR_PDA ) {
|
||||
// in-game PDA Editor
|
||||
PDAEditorRun();
|
||||
}
|
||||
}
|
||||
tools->Frame();
|
||||
}
|
||||
#endif
|
||||
// run the game
|
||||
common->Frame();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user