From 28adea33cec5ca38d28ce276ed668d4e8db9e46a Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:32:31 +0200 Subject: [PATCH 01/10] [CMAKE] Remove obsolete interface libraries, add missing core gameengine include interface library From 5406baac1bcb1f179e8670e8d89902f723f2a7d6 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Tue, 24 Jun 2025 20:05:57 +0200 Subject: [PATCH 02/10] [ZH] Fix black terrain in World Builder without RTS_DEBUG --- Core/GameEngine/Include/Common/GameDefines.h | 7 +++++++ GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h | 1 + GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | 5 +++-- .../Code/GameEngine/Include/Precompiled/PreRTS.h | 1 - .../Code/GameEngine/Source/Common/CommandLine.cpp | 8 ++++++-- .../Code/GameEngine/Source/Common/GlobalData.cpp | 10 ++++++++-- .../Code/GameEngine/Source/GameClient/GameClient.cpp | 4 ++-- .../Code/GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/W3DDevice/Common/System/W3DRadar.cpp | 6 +++--- .../Source/W3DDevice/GameClient/BaseHeightMap.cpp | 2 +- .../Source/W3DDevice/GameClient/W3DScene.cpp | 4 ++-- .../Source/W3DDevice/GameClient/W3DView.cpp | 2 +- .../Code/Tools/WorldBuilder/src/WorldBuilder.cpp | 4 ++-- 13 files changed, 37 insertions(+), 19 deletions(-) diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 447fa7d32e..8ceebbac92 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -32,3 +32,10 @@ #ifndef ENABLE_GAMETEXT_SUBSTITUTES #define ENABLE_GAMETEXT_SUBSTITUTES (1) // The code can provide substitute texts when labels and strings are missing in the STR or CSF translation file #endif + +// Originally the configurable shroud sat behind #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +// Disable RTS_CONFIGURABLE_SHROUD to make shroud hacking a bit more difficult in Release game builds. +// Enable RTS_CONFIGURABLE_SHROUD to properly draw the terrain in World Builder without RTS_DEBUG compiled in. +#ifndef RTS_CONFIGURABLE_SHROUD +#define RTS_CONFIGURABLE_SHROUD (1) // When enabled, the GlobalData contains a field to turn on/off the shroud, otherwise shroud is always enabled +#endif diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h b/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h index 7d48670358..367cdb9c12 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h @@ -58,6 +58,7 @@ // ---------------------------------------------------------------------------------------------- #include "Lib/BaseType.h" +#include "Common/GameDefines.h" // ---------------------------------------------------------------------------------------------- #if defined(RTS_INTERNAL) || defined(RTS_DEBUG) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 0f5f15b5fc..09644b148f 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -39,7 +39,6 @@ #include "Common/SubsystemInterface.h" #include "GameClient/Color.h" #include "Common/STLTypedefs.h" -#include "Common/GameCommon.h" #include "Common/Money.h" // FORWARD DECLARATIONS /////////////////////////////////////////////////////////////////////////// @@ -482,12 +481,14 @@ class GlobalData : public SubsystemInterface Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! +#if RTS_CONFIGURABLE_SHROUD + Bool m_shroudOn; +#endif #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) Bool m_wireframe; Bool m_stateMachineDebug; Bool m_useCameraConstraints; - Bool m_shroudOn; Bool m_fogOfWarOn; Bool m_jabberOn; Bool m_munkeeOn; diff --git a/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h b/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h index 1ecc85d85c..c9db802fb0 100644 --- a/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h +++ b/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h @@ -111,7 +111,6 @@ class STLSpecialAlloc; #include "Common/SubsystemInterface.h" #include "Common/GameCommon.h" -#include "Common/GameDefines.h" #include "Common/GameMemory.h" #include "Common/GameType.h" #include "Common/GlobalData.h" diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp index dc967b179c..5513bb0de9 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp @@ -723,7 +723,7 @@ Int parseNoFX(char *args[], int) return 1; } -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) Int parseNoShroud(char *args[], int) { TheWritableGlobalData->m_shroudOn = FALSE; @@ -1244,6 +1244,11 @@ static CommandLineParam paramsForEngineInit[] = // Number of frames between each CRC that is written to replay files in singleplayer games. { "-ReplayCRCInterval", parseReplayCRCInterval }, #endif + +#if RTS_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) + { "-noshroud", parseNoShroud }, +#endif + #if (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) { "-saveAllStats", parseSaveAllStats }, { "-noDraw", parseNoDraw }, @@ -1282,7 +1287,6 @@ static CommandLineParam paramsForEngineInit[] = { "-vTune", parseVTune }, { "-selectTheUnselectable", parseSelectAll }, { "-RunAhead", parseRunAhead }, - { "-noshroud", parseNoShroud }, { "-forceBenchmark", parseForceBenchmark }, { "-buildmapcache", parseBuildMapCache }, { "-noshadowvolumes", parseNoShadows }, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 4ef49c0e36..3ce8ca9356 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -488,6 +488,10 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "KeyboardCameraRotateSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardCameraRotateSpeed ) }, { "PlayStats", INI::parseInt, NULL, offsetof( GlobalData, m_playStats ) }, +#if RTS_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) + { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, +#endif + #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) { "DisableCameraFade", INI::parseBool, NULL, offsetof( GlobalData, m_disableCameraFade ) }, { "DisableScriptedInputDisabling", INI::parseBool, NULL, offsetof( GlobalData, m_disableScriptedInputDisabling ) }, @@ -497,7 +501,6 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "Wireframe", INI::parseBool, NULL, offsetof( GlobalData, m_wireframe ) }, { "StateMachineDebug", INI::parseBool, NULL, offsetof( GlobalData, m_stateMachineDebug ) }, { "UseCameraConstraints", INI::parseBool, NULL, offsetof( GlobalData, m_useCameraConstraints ) }, - { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, { "FogOfWarOn", INI::parseBool, NULL, offsetof( GlobalData, m_fogOfWarOn ) }, { "ShowCollisionExtents", INI::parseBool, NULL, offsetof( GlobalData, m_showCollisionExtents ) }, { "ShowAudioLocations", INI::parseBool, NULL, offsetof( GlobalData, m_showAudioLocations ) }, @@ -548,11 +551,14 @@ GlobalData::GlobalData() #endif m_TiVOFastMode = FALSE; +#if RTS_CONFIGURABLE_SHROUD + m_shroudOn = TRUE; +#endif + #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) m_wireframe = 0; m_stateMachineDebug = FALSE; m_useCameraConstraints = TRUE; - m_shroudOn = TRUE; m_fogOfWarOn = FALSE; m_jabberOn = FALSE; m_munkeeOn = FALSE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index c072e3d0d0..674b43b341 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -657,7 +657,7 @@ void GameClient::update( void ) if (!freezeTime) { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) #else if (true) @@ -688,7 +688,7 @@ void GameClient::update( void ) while (draw) { // update() could free the Drawable, so go ahead and grab 'next' Drawable* next = draw->getNextDrawable(); -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) #else if (true) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index e540c5ab11..4db334032a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -2548,7 +2548,7 @@ void InGameUI::createCommandHint( const GameMessage *msg ) { const Object* obj = draw->getObject(); Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0; -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); #else ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index 83a97510fb..fe42dfd2e1 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -1255,7 +1255,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) //------------------------------------------------------------------------------------------------- void W3DRadar::clearShroud() { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) return; #endif @@ -1275,7 +1275,7 @@ void W3DRadar::clearShroud() //------------------------------------------------------------------------------------------------- void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting) { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) return; #endif @@ -1412,7 +1412,7 @@ void W3DRadar::draw( Int pixelX, Int pixelY, Int width, Int height ) TheDisplay->drawImage( m_overlayImage, ul.x, ul.y, lr.x, lr.y ); // draw the shroud image -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if( TheGlobalData->m_shroudOn ) #else if (true) diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp index bc7601a24d..9f6c75e61c 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp @@ -320,7 +320,7 @@ BaseHeightMapRenderObjClass::BaseHeightMapRenderObjClass(void) #ifdef DO_ROADS m_roadBuffer = NEW W3DRoadBuffer; #endif -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) m_shroud = NEW W3DShroud; #else diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp index 072cae84f0..860c9f5262 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp @@ -105,7 +105,7 @@ RTS3DScene::RTS3DScene() m_scratchLight = NEW_REF( LightClass, (LightClass::DIRECTIONAL) ); // REF_PTR_SET(m_globalLight[lightIndex], pLight); -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) m_shroudMaterialPass = NEW_REF(W3DShroudMaterialPassClass,()); else @@ -796,7 +796,7 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, I if (drawInfo) { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) ss = OBJECTSHROUD_CLEAR; #endif diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index 26b369fac0..f6773c001d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -994,7 +994,7 @@ static void drawablePostDraw( Drawable *draw, void *userData ) Object* obj = draw->getObject(); Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0; -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if RTS_CONFIGURABLE_SHROUD ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); #else ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index d9c1aa9476..0a8752de56 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -433,8 +433,8 @@ BOOL CWorldBuilderApp::InitInstance() DEBUG_ASSERTCRASH(!TheGlobalData->m_useHalfHeightMap, ("TheGlobalData->m_useHalfHeightMap : Don't use this setting in WB.")); TheWritableGlobalData->m_useHalfHeightMap = false; -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) - // WB never uses the shroud. +#if RTS_CONFIGURABLE_SHROUD + // WB never uses the shroud. With shroud, terrain is black. TheWritableGlobalData->m_shroudOn = FALSE; #endif From b0ef819c2278fba9e2adb993de5b0f1480bf07c7 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:21:49 +0200 Subject: [PATCH 03/10] Rename macro to ENABLE_CONFIGURABLE_SHROUD --- Core/GameEngine/Include/Common/GameDefines.h | 8 ++++---- GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | 2 +- GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp | 4 ++-- GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp | 4 ++-- .../Code/GameEngine/Source/GameClient/GameClient.cpp | 4 ++-- GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/W3DDevice/Common/System/W3DRadar.cpp | 6 +++--- .../Source/W3DDevice/GameClient/BaseHeightMap.cpp | 2 +- .../Source/W3DDevice/GameClient/W3DScene.cpp | 4 ++-- .../Source/W3DDevice/GameClient/W3DView.cpp | 2 +- GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 8ceebbac92..d30ec82109 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -34,8 +34,8 @@ #endif // Originally the configurable shroud sat behind #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) -// Disable RTS_CONFIGURABLE_SHROUD to make shroud hacking a bit more difficult in Release game builds. -// Enable RTS_CONFIGURABLE_SHROUD to properly draw the terrain in World Builder without RTS_DEBUG compiled in. -#ifndef RTS_CONFIGURABLE_SHROUD -#define RTS_CONFIGURABLE_SHROUD (1) // When enabled, the GlobalData contains a field to turn on/off the shroud, otherwise shroud is always enabled +// Enable the configurable shroud to properly draw the terrain in World Builder without RTS_DEBUG compiled in. +// Disable the configurable shroud to make shroud hacking a bit less accessible in Release game builds. +#ifndef ENABLE_CONFIGURABLE_SHROUD +#define ENABLE_CONFIGURABLE_SHROUD (1) // When enabled, the GlobalData contains a field to turn on/off the shroud, otherwise shroud is always enabled #endif diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 09644b148f..edc174415f 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -481,7 +481,7 @@ class GlobalData : public SubsystemInterface Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD Bool m_shroudOn; #endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp index 5513bb0de9..718ede2602 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp @@ -723,7 +723,7 @@ Int parseNoFX(char *args[], int) return 1; } -#if RTS_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) +#if ENABLE_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) Int parseNoShroud(char *args[], int) { TheWritableGlobalData->m_shroudOn = FALSE; @@ -1245,7 +1245,7 @@ static CommandLineParam paramsForEngineInit[] = { "-ReplayCRCInterval", parseReplayCRCInterval }, #endif -#if RTS_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) +#if ENABLE_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) { "-noshroud", parseNoShroud }, #endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 3ce8ca9356..bbe9daa840 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -488,7 +488,7 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "KeyboardCameraRotateSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardCameraRotateSpeed ) }, { "PlayStats", INI::parseInt, NULL, offsetof( GlobalData, m_playStats ) }, -#if RTS_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) +#if ENABLE_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, #endif @@ -551,7 +551,7 @@ GlobalData::GlobalData() #endif m_TiVOFastMode = FALSE; -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD m_shroudOn = TRUE; #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index 674b43b341..fbc3b4d5f1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -657,7 +657,7 @@ void GameClient::update( void ) if (!freezeTime) { -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) #else if (true) @@ -688,7 +688,7 @@ void GameClient::update( void ) while (draw) { // update() could free the Drawable, so go ahead and grab 'next' Drawable* next = draw->getNextDrawable(); -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) #else if (true) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index 4db334032a..704a352985 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -2548,7 +2548,7 @@ void InGameUI::createCommandHint( const GameMessage *msg ) { const Object* obj = draw->getObject(); Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0; -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); #else ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index fe42dfd2e1..c603ebc544 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -1255,7 +1255,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) //------------------------------------------------------------------------------------------------- void W3DRadar::clearShroud() { -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) return; #endif @@ -1275,7 +1275,7 @@ void W3DRadar::clearShroud() //------------------------------------------------------------------------------------------------- void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting) { -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) return; #endif @@ -1412,7 +1412,7 @@ void W3DRadar::draw( Int pixelX, Int pixelY, Int width, Int height ) TheDisplay->drawImage( m_overlayImage, ul.x, ul.y, lr.x, lr.y ); // draw the shroud image -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if( TheGlobalData->m_shroudOn ) #else if (true) diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp index 9f6c75e61c..f295f0218e 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp @@ -320,7 +320,7 @@ BaseHeightMapRenderObjClass::BaseHeightMapRenderObjClass(void) #ifdef DO_ROADS m_roadBuffer = NEW W3DRoadBuffer; #endif -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) m_shroud = NEW W3DShroud; #else diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp index 860c9f5262..590168d777 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp @@ -105,7 +105,7 @@ RTS3DScene::RTS3DScene() m_scratchLight = NEW_REF( LightClass, (LightClass::DIRECTIONAL) ); // REF_PTR_SET(m_globalLight[lightIndex], pLight); -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) m_shroudMaterialPass = NEW_REF(W3DShroudMaterialPassClass,()); else @@ -796,7 +796,7 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, I if (drawInfo) { -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) ss = OBJECTSHROUD_CLEAR; #endif diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index f6773c001d..d33ae55a20 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -994,7 +994,7 @@ static void drawablePostDraw( Drawable *draw, void *userData ) Object* obj = draw->getObject(); Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0; -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); #else ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 0a8752de56..5276dbfc9d 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -433,7 +433,7 @@ BOOL CWorldBuilderApp::InitInstance() DEBUG_ASSERTCRASH(!TheGlobalData->m_useHalfHeightMap, ("TheGlobalData->m_useHalfHeightMap : Don't use this setting in WB.")); TheWritableGlobalData->m_useHalfHeightMap = false; -#if RTS_CONFIGURABLE_SHROUD +#if ENABLE_CONFIGURABLE_SHROUD // WB never uses the shroud. With shroud, terrain is black. TheWritableGlobalData->m_shroudOn = FALSE; #endif From a3b58b6ce0fb4b8424b5c8d59d6f95752aa383b1 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 30 Jun 2025 23:03:17 +0200 Subject: [PATCH 04/10] Replicate in Generals --- Generals/Code/GameEngine/Include/Common/GameCommon.h | 1 + Generals/Code/GameEngine/Include/Common/GlobalData.h | 4 +++- Generals/Code/GameEngine/Include/Precompiled/PreRTS.h | 1 - Generals/Code/GameEngine/Source/Common/CommandLine.cpp | 8 ++++++-- Generals/Code/GameEngine/Source/Common/GlobalData.cpp | 10 ++++++++-- .../Code/GameEngine/Source/GameClient/GameClient.cpp | 4 ++-- .../Code/GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/W3DDevice/Common/System/W3DRadar.cpp | 6 +++--- .../Source/W3DDevice/GameClient/W3DScene.cpp | 4 ++-- .../Source/W3DDevice/GameClient/W3DView.cpp | 2 +- Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp | 4 ++-- 11 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/GameCommon.h b/Generals/Code/GameEngine/Include/Common/GameCommon.h index 54c6145432..08b92230a4 100644 --- a/Generals/Code/GameEngine/Include/Common/GameCommon.h +++ b/Generals/Code/GameEngine/Include/Common/GameCommon.h @@ -52,6 +52,7 @@ // ---------------------------------------------------------------------------------------------- #include "Lib/BaseType.h" +#include "Common/GameDefines.h" // ---------------------------------------------------------------------------------------------- #if defined(RTS_INTERNAL) || defined(RTS_DEBUG) diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index c0b8ef93ea..a650649ab1 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -467,13 +467,15 @@ class GlobalData : public SubsystemInterface Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! +#if ENABLE_CONFIGURABLE_SHROUD + Bool m_shroudOn; +#endif #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) Bool m_wireframe; Bool m_stateMachineDebug; Bool m_useCameraConstraints; Bool m_specialPowerUsesDelay; - Bool m_shroudOn; Bool m_fogOfWarOn; Bool m_jabberOn; Bool m_munkeeOn; diff --git a/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h b/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h index cd2daff73a..361876de40 100644 --- a/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h +++ b/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h @@ -111,7 +111,6 @@ class STLSpecialAlloc; #include "Common/SubsystemInterface.h" #include "Common/GameCommon.h" -#include "Common/GameDefines.h" #include "Common/GameMemory.h" #include "Common/GameType.h" #include "Common/GlobalData.h" diff --git a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp index ec75d89b2f..4690e2efc5 100644 --- a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp @@ -723,7 +723,7 @@ Int parseNoFX(char *args[], int) return 1; } -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) Int parseNoShroud(char *args[], int) { TheWritableGlobalData->m_shroudOn = FALSE; @@ -1244,6 +1244,11 @@ static CommandLineParam paramsForEngineInit[] = // Number of frames between each CRC that is written to replay files in singleplayer games. { "-ReplayCRCInterval", parseReplayCRCInterval }, #endif + +#if ENABLE_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) + { "-noshroud", parseNoShroud }, +#endif + #if (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) { "-saveAllStats", parseSaveAllStats }, { "-noDraw", parseNoDraw }, @@ -1282,7 +1287,6 @@ static CommandLineParam paramsForEngineInit[] = { "-vTune", parseVTune }, { "-selectTheUnselectable", parseSelectAll }, { "-RunAhead", parseRunAhead }, - { "-noshroud", parseNoShroud }, { "-forceBenchmark", parseForceBenchmark }, { "-buildmapcache", parseBuildMapCache }, { "-noshadowvolumes", parseNoShadows }, diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 6bb08c3bd9..f6984da73c 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -488,6 +488,10 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "KeyboardCameraRotateSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardCameraRotateSpeed ) }, { "PlayStats", INI::parseInt, NULL, offsetof( GlobalData, m_playStats ) }, +#if ENABLE_CONFIGURABLE_SHROUD && (defined(RTS_DEBUG) || defined(RTS_INTERNAL)) + { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, +#endif + #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) { "DisableCameraFade", INI::parseBool, NULL, offsetof( GlobalData, m_disableCameraFade ) }, { "DisableScriptedInputDisabling", INI::parseBool, NULL, offsetof( GlobalData, m_disableScriptedInputDisabling ) }, @@ -497,7 +501,6 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "Wireframe", INI::parseBool, NULL, offsetof( GlobalData, m_wireframe ) }, { "StateMachineDebug", INI::parseBool, NULL, offsetof( GlobalData, m_stateMachineDebug ) }, { "UseCameraConstraints", INI::parseBool, NULL, offsetof( GlobalData, m_useCameraConstraints ) }, - { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, { "FogOfWarOn", INI::parseBool, NULL, offsetof( GlobalData, m_fogOfWarOn ) }, { "ShowCollisionExtents", INI::parseBool, NULL, offsetof( GlobalData, m_showCollisionExtents ) }, { "ShowAudioLocations", INI::parseBool, NULL, offsetof( GlobalData, m_showAudioLocations ) }, @@ -545,11 +548,14 @@ GlobalData::GlobalData() m_TiVOFastMode = FALSE; +#if ENABLE_CONFIGURABLE_SHROUD + m_shroudOn = TRUE; +#endif + #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) m_wireframe = 0; m_stateMachineDebug = FALSE; m_useCameraConstraints = TRUE; - m_shroudOn = TRUE; m_fogOfWarOn = FALSE; m_jabberOn = FALSE; m_munkeeOn = FALSE; diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index 07ac79f01f..b408471e22 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -619,7 +619,7 @@ void GameClient::update( void ) if (!freezeTime) { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) #else if (true) @@ -650,7 +650,7 @@ void GameClient::update( void ) while (draw) { // update() could free the Drawable, so go ahead and grab 'next' Drawable* next = draw->getNextDrawable(); -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) #else if (true) diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index d2fb1bef95..2195509b65 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -2488,7 +2488,7 @@ void InGameUI::createCommandHint( const GameMessage *msg ) { const Object* obj = draw->getObject(); Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0; -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); #else ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index 55ed9ee9fe..d7c23f9468 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -1267,7 +1267,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) //------------------------------------------------------------------------------------------------- void W3DRadar::clearShroud() { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) return; #endif @@ -1287,7 +1287,7 @@ void W3DRadar::clearShroud() //------------------------------------------------------------------------------------------------- void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting) { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) return; #endif @@ -1424,7 +1424,7 @@ void W3DRadar::draw( Int pixelX, Int pixelY, Int width, Int height ) TheDisplay->drawImage( m_overlayImage, ul.x, ul.y, lr.x, lr.y ); // draw the shroud image -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if( TheGlobalData->m_shroudOn ) #else if (true) diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp index 05ff57069e..869b153d85 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp @@ -104,7 +104,7 @@ RTS3DScene::RTS3DScene() m_scratchLight = NEW_REF( LightClass, (LightClass::DIRECTIONAL) ); // REF_PTR_SET(m_globalLight[lightIndex], pLight); -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if (TheGlobalData->m_shroudOn) m_shroudMaterialPass = NEW_REF(W3DShroudMaterialPassClass,()); else @@ -758,7 +758,7 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, I if (drawInfo) { -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD if (!TheGlobalData->m_shroudOn) ss = OBJECTSHROUD_CLEAR; #endif diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index a4ff36e2d3..c677bfe1cb 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -850,7 +850,7 @@ static void drawablePostDraw( Drawable *draw, void *userData ) Object* obj = draw->getObject(); Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0; -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#if ENABLE_CONFIGURABLE_SHROUD ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); #else ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex); diff --git a/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 7024305a4b..8760a50347 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -411,8 +411,8 @@ BOOL CWorldBuilderApp::InitInstance() DEBUG_ASSERTCRASH(!TheGlobalData->m_useHalfHeightMap, ("TheGlobalData->m_useHalfHeightMap : Don't use this setting in WB.")); TheWritableGlobalData->m_useHalfHeightMap = false; -#if defined(RTS_DEBUG) || defined(RTS_INTERNAL) - // WB never uses the shroud. +#if ENABLE_CONFIGURABLE_SHROUD + // WB never uses the shroud. With shroud, terrain is black. TheWritableGlobalData->m_shroudOn = FALSE; #endif From 66b5e728756a306c05cb60ab422f50efda39226a Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 30 Jun 2025 23:04:03 +0200 Subject: [PATCH 05/10] Remove nearby whitespace in GlobalData.h --- Generals/Code/GameEngine/Include/Common/GlobalData.h | 1 - GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | 1 - 2 files changed, 2 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index a650649ab1..6120b9dedb 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -465,7 +465,6 @@ class GlobalData : public SubsystemInterface Int m_playStats; ///< Int whether we want to log play stats or not, if <= 0 then we don't log Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! - #if ENABLE_CONFIGURABLE_SHROUD Bool m_shroudOn; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index edc174415f..f93490d89b 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -479,7 +479,6 @@ class GlobalData : public SubsystemInterface Bool m_specialPowerUsesDelay ; #endif Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! - #if ENABLE_CONFIGURABLE_SHROUD Bool m_shroudOn; From a5aa1928ce6eb6a5e7c351144b69679b72c4f243 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:17:06 +0200 Subject: [PATCH 06/10] Update comment --- Core/GameEngine/Include/Common/GameDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 733529bb7f..5ae9d2a9f0 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -41,7 +41,7 @@ #define ENABLE_GAMETEXT_SUBSTITUTES (1) // The code can provide substitute texts when labels and strings are missing in the STR or CSF translation file #endif -// Originally the configurable shroud sat behind #if defined(RTS_DEBUG) || defined(RTS_INTERNAL) +// Previously the configurable shroud sat behind #if defined(RTS_DEBUG) // Enable the configurable shroud to properly draw the terrain in World Builder without RTS_DEBUG compiled in. // Disable the configurable shroud to make shroud hacking a bit less accessible in Release game builds. #ifndef ENABLE_CONFIGURABLE_SHROUD From 0af0dbe3834c5b1a80c21ffba8379279d17b8184 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:47:03 +0200 Subject: [PATCH 07/10] Fix ShroudOn INI parsing --- Generals/Code/GameEngine/Include/Common/GlobalData.h | 5 ++--- Generals/Code/GameEngine/Source/Common/GlobalData.cpp | 9 ++------- GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | 5 ++--- .../Code/GameEngine/Source/Common/GlobalData.cpp | 10 ++-------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index 5bfb8963f1..6c40a7a099 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -466,15 +466,14 @@ class GlobalData : public SubsystemInterface Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! -#if ENABLE_CONFIGURABLE_SHROUD - Bool m_shroudOn; -#endif + #if defined(RTS_DEBUG) Bool m_wireframe; Bool m_stateMachineDebug; Bool m_useCameraConstraints; Bool m_specialPowerUsesDelay; + Bool m_shroudOn; Bool m_fogOfWarOn; Bool m_jabberOn; Bool m_munkeeOn; diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 15aaac1449..657c80f849 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -488,10 +488,6 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "KeyboardCameraRotateSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardCameraRotateSpeed ) }, { "PlayStats", INI::parseInt, NULL, offsetof( GlobalData, m_playStats ) }, -#if ENABLE_CONFIGURABLE_SHROUD && defined(RTS_DEBUG) - { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, -#endif - #if defined(RTS_DEBUG) { "DisableCameraFade", INI::parseBool, NULL, offsetof( GlobalData, m_disableCameraFade ) }, { "DisableScriptedInputDisabling", INI::parseBool, NULL, offsetof( GlobalData, m_disableScriptedInputDisabling ) }, @@ -501,6 +497,7 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "Wireframe", INI::parseBool, NULL, offsetof( GlobalData, m_wireframe ) }, { "StateMachineDebug", INI::parseBool, NULL, offsetof( GlobalData, m_stateMachineDebug ) }, { "UseCameraConstraints", INI::parseBool, NULL, offsetof( GlobalData, m_useCameraConstraints ) }, + { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, { "FogOfWarOn", INI::parseBool, NULL, offsetof( GlobalData, m_fogOfWarOn ) }, { "ShowCollisionExtents", INI::parseBool, NULL, offsetof( GlobalData, m_showCollisionExtents ) }, { "ShowAudioLocations", INI::parseBool, NULL, offsetof( GlobalData, m_showAudioLocations ) }, @@ -548,14 +545,12 @@ GlobalData::GlobalData() m_TiVOFastMode = FALSE; -#if ENABLE_CONFIGURABLE_SHROUD - m_shroudOn = TRUE; -#endif #if defined(RTS_DEBUG) m_wireframe = 0; m_stateMachineDebug = FALSE; m_useCameraConstraints = TRUE; + m_shroudOn = TRUE; m_fogOfWarOn = FALSE; m_jabberOn = FALSE; m_munkeeOn = FALSE; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 7ab3a2781b..8edd10da48 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -480,14 +480,13 @@ class GlobalData : public SubsystemInterface #endif Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! -#if ENABLE_CONFIGURABLE_SHROUD - Bool m_shroudOn; -#endif + #if defined(RTS_DEBUG) Bool m_wireframe; Bool m_stateMachineDebug; Bool m_useCameraConstraints; + Bool m_shroudOn; Bool m_fogOfWarOn; Bool m_jabberOn; Bool m_munkeeOn; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 4d45d879a4..7e4469e0ae 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -488,10 +488,6 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "KeyboardCameraRotateSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardCameraRotateSpeed ) }, { "PlayStats", INI::parseInt, NULL, offsetof( GlobalData, m_playStats ) }, -#if ENABLE_CONFIGURABLE_SHROUD && defined(RTS_DEBUG) - { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, -#endif - #if defined(RTS_DEBUG) { "DisableCameraFade", INI::parseBool, NULL, offsetof( GlobalData, m_disableCameraFade ) }, { "DisableScriptedInputDisabling", INI::parseBool, NULL, offsetof( GlobalData, m_disableScriptedInputDisabling ) }, @@ -501,6 +497,7 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "Wireframe", INI::parseBool, NULL, offsetof( GlobalData, m_wireframe ) }, { "StateMachineDebug", INI::parseBool, NULL, offsetof( GlobalData, m_stateMachineDebug ) }, { "UseCameraConstraints", INI::parseBool, NULL, offsetof( GlobalData, m_useCameraConstraints ) }, + { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) }, { "FogOfWarOn", INI::parseBool, NULL, offsetof( GlobalData, m_fogOfWarOn ) }, { "ShowCollisionExtents", INI::parseBool, NULL, offsetof( GlobalData, m_showCollisionExtents ) }, { "ShowAudioLocations", INI::parseBool, NULL, offsetof( GlobalData, m_showAudioLocations ) }, @@ -551,14 +548,11 @@ GlobalData::GlobalData() #endif m_TiVOFastMode = FALSE; -#if ENABLE_CONFIGURABLE_SHROUD - m_shroudOn = TRUE; -#endif - #if defined(RTS_DEBUG) m_wireframe = 0; m_stateMachineDebug = FALSE; m_useCameraConstraints = TRUE; + m_shroudOn = TRUE; m_fogOfWarOn = FALSE; m_jabberOn = FALSE; m_munkeeOn = FALSE; From 928bf980e41d74d3acca6fb2fb7cc045dc9d0cec Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:48:54 +0200 Subject: [PATCH 08/10] Fix whitespace --- Generals/Code/GameEngine/Include/Common/GlobalData.h | 2 +- Generals/Code/GameEngine/Source/Common/GlobalData.cpp | 1 - GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index 6c40a7a099..19cb080c38 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -465,7 +465,7 @@ class GlobalData : public SubsystemInterface Int m_playStats; ///< Int whether we want to log play stats or not, if <= 0 then we don't log Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! - + #if defined(RTS_DEBUG) diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 657c80f849..220d0c5aa0 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -545,7 +545,6 @@ GlobalData::GlobalData() m_TiVOFastMode = FALSE; - #if defined(RTS_DEBUG) m_wireframe = 0; m_stateMachineDebug = FALSE; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 8edd10da48..d09d0f6d2d 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -479,7 +479,7 @@ class GlobalData : public SubsystemInterface Bool m_specialPowerUsesDelay ; #endif Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! - + #if defined(RTS_DEBUG) From 03856956307c1bcecfff94c24a7347bb2bd568ce Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:52:31 +0200 Subject: [PATCH 09/10] Simplify CommandLine change --- Generals/Code/GameEngine/Source/Common/CommandLine.cpp | 8 +++----- GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp index 426940da79..0db42be413 100644 --- a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp @@ -1239,11 +1239,6 @@ static CommandLineParam paramsForEngineInit[] = // Number of frames between each CRC that is written to replay files in singleplayer games. { "-ReplayCRCInterval", parseReplayCRCInterval }, #endif - -#if ENABLE_CONFIGURABLE_SHROUD && defined(RTS_DEBUG) - { "-noshroud", parseNoShroud }, -#endif - #if defined(RTS_DEBUG) { "-saveAllStats", parseSaveAllStats }, { "-noDraw", parseNoDraw }, @@ -1282,6 +1277,9 @@ static CommandLineParam paramsForEngineInit[] = { "-vTune", parseVTune }, { "-selectTheUnselectable", parseSelectAll }, { "-RunAhead", parseRunAhead }, +#if ENABLE_CONFIGURABLE_SHROUD + { "-noshroud", parseNoShroud }, +#endif { "-forceBenchmark", parseForceBenchmark }, { "-buildmapcache", parseBuildMapCache }, { "-noshadowvolumes", parseNoShadows }, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp index e5eea01a48..4bf1e29e41 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp @@ -1239,11 +1239,6 @@ static CommandLineParam paramsForEngineInit[] = // Number of frames between each CRC that is written to replay files in singleplayer games. { "-ReplayCRCInterval", parseReplayCRCInterval }, #endif - -#if ENABLE_CONFIGURABLE_SHROUD && defined(RTS_DEBUG) - { "-noshroud", parseNoShroud }, -#endif - #if defined(RTS_DEBUG) { "-saveAllStats", parseSaveAllStats }, { "-noDraw", parseNoDraw }, @@ -1282,6 +1277,9 @@ static CommandLineParam paramsForEngineInit[] = { "-vTune", parseVTune }, { "-selectTheUnselectable", parseSelectAll }, { "-RunAhead", parseRunAhead }, +#if ENABLE_CONFIGURABLE_SHROUD + { "-noshroud", parseNoShroud }, +#endif { "-forceBenchmark", parseForceBenchmark }, { "-buildmapcache", parseBuildMapCache }, { "-noshadowvolumes", parseNoShadows }, From 7678ffe7c22c9ff2f250bd71a5b86ddb1e468ab4 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Fri, 11 Jul 2025 23:13:49 +0200 Subject: [PATCH 10/10] Fix Release build compile --- Generals/Code/GameEngine/Include/Common/GlobalData.h | 5 +++-- Generals/Code/GameEngine/Source/Common/CommandLine.cpp | 2 +- Generals/Code/GameEngine/Source/Common/GlobalData.cpp | 5 ++++- GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h | 5 +++-- GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp | 2 +- GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp | 5 ++++- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/GlobalData.h b/Generals/Code/GameEngine/Include/Common/GlobalData.h index 19cb080c38..191c9c9697 100644 --- a/Generals/Code/GameEngine/Include/Common/GlobalData.h +++ b/Generals/Code/GameEngine/Include/Common/GlobalData.h @@ -465,15 +465,16 @@ class GlobalData : public SubsystemInterface Int m_playStats; ///< Int whether we want to log play stats or not, if <= 0 then we don't log Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! - +#if defined(RTS_DEBUG) || ENABLE_CONFIGURABLE_SHROUD + Bool m_shroudOn; +#endif #if defined(RTS_DEBUG) Bool m_wireframe; Bool m_stateMachineDebug; Bool m_useCameraConstraints; Bool m_specialPowerUsesDelay; - Bool m_shroudOn; Bool m_fogOfWarOn; Bool m_jabberOn; Bool m_munkeeOn; diff --git a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp index 0db42be413..b8bc89d8bb 100644 --- a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp @@ -718,7 +718,7 @@ Int parseNoFX(char *args[], int) return 1; } -#if ENABLE_CONFIGURABLE_SHROUD && defined(RTS_DEBUG) +#if defined(RTS_DEBUG) && ENABLE_CONFIGURABLE_SHROUD Int parseNoShroud(char *args[], int) { TheWritableGlobalData->m_shroudOn = FALSE; diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 220d0c5aa0..ac732f888b 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -545,11 +545,14 @@ GlobalData::GlobalData() m_TiVOFastMode = FALSE; +#if defined(RTS_DEBUG) || ENABLE_CONFIGURABLE_SHROUD + m_shroudOn = TRUE; +#endif + #if defined(RTS_DEBUG) m_wireframe = 0; m_stateMachineDebug = FALSE; m_useCameraConstraints = TRUE; - m_shroudOn = TRUE; m_fogOfWarOn = FALSE; m_jabberOn = FALSE; m_munkeeOn = FALSE; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index d09d0f6d2d..c1f328e4ca 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -479,14 +479,15 @@ class GlobalData : public SubsystemInterface Bool m_specialPowerUsesDelay ; #endif Bool m_TiVOFastMode; ///< When true, the client speeds up the framerate... set by HOTKEY! - +#if defined(RTS_DEBUG) || ENABLE_CONFIGURABLE_SHROUD + Bool m_shroudOn; +#endif #if defined(RTS_DEBUG) Bool m_wireframe; Bool m_stateMachineDebug; Bool m_useCameraConstraints; - Bool m_shroudOn; Bool m_fogOfWarOn; Bool m_jabberOn; Bool m_munkeeOn; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp index 4bf1e29e41..0dbf428642 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp @@ -718,7 +718,7 @@ Int parseNoFX(char *args[], int) return 1; } -#if ENABLE_CONFIGURABLE_SHROUD && defined(RTS_DEBUG) +#if defined(RTS_DEBUG) && ENABLE_CONFIGURABLE_SHROUD Int parseNoShroud(char *args[], int) { TheWritableGlobalData->m_shroudOn = FALSE; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 7e4469e0ae..f4289e2bd1 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -548,11 +548,14 @@ GlobalData::GlobalData() #endif m_TiVOFastMode = FALSE; +#if defined(RTS_DEBUG) || ENABLE_CONFIGURABLE_SHROUD + m_shroudOn = TRUE; +#endif + #if defined(RTS_DEBUG) m_wireframe = 0; m_stateMachineDebug = FALSE; m_useCameraConstraints = TRUE; - m_shroudOn = TRUE; m_fogOfWarOn = FALSE; m_jabberOn = FALSE; m_munkeeOn = FALSE;