diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 447fa7d32e..d30ec82109 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) +// 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/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..6120b9dedb 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 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 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..f93490d89b 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 /////////////////////////////////////////////////////////////////////////// @@ -480,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 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_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..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 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/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 4ef49c0e36..bbe9daa840 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 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 ) }, @@ -548,11 +551,14 @@ GlobalData::GlobalData() #endif 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/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index c072e3d0d0..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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 e540c5ab11..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 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/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index 83a97510fb..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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 bc7601a24d..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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 072cae84f0..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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 defined(RTS_DEBUG) || defined(RTS_INTERNAL) +#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 26b369fac0..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 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/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index d9c1aa9476..5276dbfc9d 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 ENABLE_CONFIGURABLE_SHROUD + // WB never uses the shroud. With shroud, terrain is black. TheWritableGlobalData->m_shroudOn = FALSE; #endif