From ba32415d77c1be748f0c5560db28870aea9afd20 Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Thu, 13 Aug 2026 11:39:42 -0700 Subject: [PATCH] Added missing cmake file. --- q4x.bat | 2 +- src/CMakeLists.txt | 5 + src/aas/AASBuild_local.h | 6 +- src/aas/AASCluster.h | 8 +- src/aas/AASFile.cpp | 44 ++++++- src/aas/AASFile.h | 2 - src/aas/AASReach.h | 8 +- src/engine/CMakeLists.txt | 20 ++- src/framework/common.cpp | 220 +++++++++++++++++++++++-------- src/framework/licensee.h | 2 + src/game/CMakeLists.txt | 56 ++++++++ src/idlib/precompiled.h | 2 +- src/renderer/material.cpp | 10 ++ src/renderer/qgl_linked.h | 7 + src/renderer/renderentity.cpp | 21 +++ src/sound/sound.h | 3 + src/sys/win32/rc/doom_resource.h | 4 +- src/sys/win32/win_main.cpp | 46 +------ 18 files changed, 349 insertions(+), 117 deletions(-) create mode 100644 src/game/CMakeLists.txt diff --git a/q4x.bat b/q4x.bat index 3451470..642c941 100644 --- a/q4x.bat +++ b/q4x.bat @@ -1,2 +1,2 @@ @echo off -start quake4 +set fs_game q4xbase \ No newline at end of file +start q4xp +set fs_game q4xbase \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 35c5d6b..11a5cab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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() diff --git a/src/aas/AASBuild_local.h b/src/aas/AASBuild_local.h index c96d92c..c0b4231 100644 --- a/src/aas/AASBuild_local.h +++ b/src/aas/AASBuild_local.h @@ -26,7 +26,7 @@ along with Quake 4 Reconstructed Source Code. If not, see 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 { diff --git a/src/aas/AASFile.h b/src/aas/AASFile.h index a844081..4ea82ce 100644 --- a/src/aas/AASFile.h +++ b/src/aas/AASFile.h @@ -281,8 +281,6 @@ public: bool allowSwimReachabilities; bool allowFlyReachabilities; // RAVEN BEGIN -// bkreimeier - bool generateAllFaces; // cdr: AASTactical bool generateTacticalFeatures; // scork: AASOnly numbers diff --git a/src/aas/AASReach.h b/src/aas/AASReach.h index d868bc8..69c27a9 100644 --- a/src/aas/AASReach.h +++ b/src/aas/AASReach.h @@ -25,6 +25,8 @@ along with Quake 4 Reconstructed Source Code. If not, see 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( + 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" ); diff --git a/src/framework/licensee.h b/src/framework/licensee.h index 9b70489..5ea2a0b 100644 --- a/src/framework/licensee.h +++ b/src/framework/licensee.h @@ -124,6 +124,8 @@ along with Quake 4 Reconstructed Source Code. If not, see :_DEBUG> + $<$: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" +) diff --git a/src/idlib/precompiled.h b/src/idlib/precompiled.h index 189c0df..f32569d 100644 --- a/src/idlib/precompiled.h +++ b/src/idlib/precompiled.h @@ -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 diff --git a/src/renderer/material.cpp b/src/renderer/material.cpp index 8a40bfb..69290cd 100644 --- a/src/renderer/material.cpp +++ b/src/renderer/material.cpp @@ -26,6 +26,16 @@ along with Quake 4 Reconstructed Source Code. If not, see 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 diff --git a/src/renderer/qgl_linked.h b/src/renderer/qgl_linked.h index 5cfb10a..3a4b562 100644 --- a/src/renderer/qgl_linked.h +++ b/src/renderer/qgl_linked.h @@ -359,6 +359,13 @@ along with Quake 4 Reconstructed Source Code. If not, see 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; diff --git a/src/sound/sound.h b/src/sound/sound.h index aeba27b..d821fdb 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -43,6 +43,9 @@ along with Quake 4 Reconstructed Source Code. If not, see 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(); }