Skip to content
7 changes: 7 additions & 0 deletions Core/GameEngine/Include/Common/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,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

// 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
#define ENABLE_CONFIGURABLE_SHROUD (1) // When enabled, the GlobalData contains a field to turn on/off the shroud, otherwise shroud is always enabled
#endif
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/Common/GameCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

// ----------------------------------------------------------------------------------------------
#include "Lib/BaseType.h"
#include "Common/GameDefines.h"

// ----------------------------------------------------------------------------------------------
#if defined(RTS_DEBUG)
Expand Down
5 changes: 3 additions & 2 deletions Generals/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion Generals/Code/GameEngine/Include/Precompiled/PreRTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion Generals/Code/GameEngine/Source/Common/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ Int parseNoFX(char *args[], int)
return 1;
}

#if defined(RTS_DEBUG)
#if defined(RTS_DEBUG) && ENABLE_CONFIGURABLE_SHROUD
Int parseNoShroud(char *args[], int)
{
TheWritableGlobalData->m_shroudOn = FALSE;
Expand Down Expand Up @@ -1277,7 +1277,9 @@ static CommandLineParam paramsForEngineInit[] =
{ "-vTune", parseVTune },
{ "-selectTheUnselectable", parseSelectAll },
{ "-RunAhead", parseRunAhead },
#if ENABLE_CONFIGURABLE_SHROUD
{ "-noshroud", parseNoShroud },
#endif
{ "-forceBenchmark", parseForceBenchmark },
{ "-buildmapcache", parseBuildMapCache },
{ "-noshadowvolumes", parseNoShadows },
Expand Down
5 changes: 4 additions & 1 deletion Generals/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Source/GameClient/GameClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ void GameClient::update( void )

if (!freezeTime)
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
#else
if (true)
Expand Down Expand Up @@ -645,7 +645,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)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
#else
if (true)
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2483,7 +2483,7 @@ void InGameUI::createCommandHint( const GameMessage *msg )
{
const Object* obj = draw->getObject();
Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0;
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
#else
ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain )
//-------------------------------------------------------------------------------------------------
void W3DRadar::clearShroud()
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (!TheGlobalData->m_shroudOn)
return;
#endif
Expand All @@ -1283,7 +1283,7 @@ void W3DRadar::clearShroud()
//-------------------------------------------------------------------------------------------------
void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting)
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (!TheGlobalData->m_shroudOn)
return;
#endif
Expand Down Expand Up @@ -1420,7 +1420,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)
#if ENABLE_CONFIGURABLE_SHROUD
if( TheGlobalData->m_shroudOn )
#else
if (true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ RTS3DScene::RTS3DScene()
m_scratchLight = NEW_REF( LightClass, (LightClass::DIRECTIONAL) );
// REF_PTR_SET(m_globalLight[lightIndex], pLight);

#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
m_shroudMaterialPass = NEW_REF(W3DShroudMaterialPassClass,());
else
Expand Down Expand Up @@ -753,7 +753,7 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, I

if (drawInfo)
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (!TheGlobalData->m_shroudOn)
ss = OBJECTSHROUD_CLEAR;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static void drawablePostDraw( Drawable *draw, void *userData )

Object* obj = draw->getObject();
Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0;
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
#else
ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,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)
// WB never uses the shroud.
#if ENABLE_CONFIGURABLE_SHROUD
// WB never uses the shroud. With shroud, terrain is black.
TheWritableGlobalData->m_shroudOn = FALSE;
#endif

Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

// ----------------------------------------------------------------------------------------------
#include "Lib/BaseType.h"
#include "Common/GameDefines.h"

// ----------------------------------------------------------------------------------------------
#if defined(RTS_DEBUG)
Expand Down
6 changes: 3 additions & 3 deletions GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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 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;
Expand Down
1 change: 0 additions & 1 deletion GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ Int parseNoFX(char *args[], int)
return 1;
}

#if defined(RTS_DEBUG)
#if defined(RTS_DEBUG) && ENABLE_CONFIGURABLE_SHROUD
Int parseNoShroud(char *args[], int)
{
TheWritableGlobalData->m_shroudOn = FALSE;
Expand Down Expand Up @@ -1277,7 +1277,9 @@ static CommandLineParam paramsForEngineInit[] =
{ "-vTune", parseVTune },
{ "-selectTheUnselectable", parseSelectAll },
{ "-RunAhead", parseRunAhead },
#if ENABLE_CONFIGURABLE_SHROUD
{ "-noshroud", parseNoShroud },
#endif
{ "-forceBenchmark", parseForceBenchmark },
{ "-buildmapcache", parseBuildMapCache },
{ "-noshadowvolumes", parseNoShadows },
Expand Down
5 changes: 4 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ void GameClient::update( void )

if (!freezeTime)
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
#else
if (true)
Expand Down Expand Up @@ -683,7 +683,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)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
#else
if (true)
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ void InGameUI::createCommandHint( const GameMessage *msg )
{
const Object* obj = draw->getObject();
Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0;
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
#else
ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain )
//-------------------------------------------------------------------------------------------------
void W3DRadar::clearShroud()
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (!TheGlobalData->m_shroudOn)
return;
#endif
Expand All @@ -1271,7 +1271,7 @@ void W3DRadar::clearShroud()
//-------------------------------------------------------------------------------------------------
void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting)
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (!TheGlobalData->m_shroudOn)
return;
#endif
Expand Down Expand Up @@ -1408,7 +1408,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)
#if ENABLE_CONFIGURABLE_SHROUD
if( TheGlobalData->m_shroudOn )
#else
if (true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ BaseHeightMapRenderObjClass::BaseHeightMapRenderObjClass(void)
#ifdef DO_ROADS
m_roadBuffer = NEW W3DRoadBuffer;
#endif
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
m_shroud = NEW W3DShroud;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ RTS3DScene::RTS3DScene()
m_scratchLight = NEW_REF( LightClass, (LightClass::DIRECTIONAL) );
// REF_PTR_SET(m_globalLight[lightIndex], pLight);

#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (TheGlobalData->m_shroudOn)
m_shroudMaterialPass = NEW_REF(W3DShroudMaterialPassClass,());
else
Expand Down Expand Up @@ -791,7 +791,7 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, I

if (drawInfo)
{
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
if (!TheGlobalData->m_shroudOn)
ss = OBJECTSHROUD_CLEAR;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ static void drawablePostDraw( Drawable *draw, void *userData )

Object* obj = draw->getObject();
Int localPlayerIndex = ThePlayerList ? ThePlayerList->getLocalPlayer()->getPlayerIndex() : 0;
#if defined(RTS_DEBUG)
#if ENABLE_CONFIGURABLE_SHROUD
ObjectShroudStatus ss = (!obj || !TheGlobalData->m_shroudOn) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
#else
ObjectShroudStatus ss = (!obj) ? OBJECTSHROUD_CLEAR : obj->getShroudedStatus(localPlayerIndex);
Expand Down
4 changes: 2 additions & 2 deletions GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,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)
// WB never uses the shroud.
#if ENABLE_CONFIGURABLE_SHROUD
// WB never uses the shroud. With shroud, terrain is black.
TheWritableGlobalData->m_shroudOn = FALSE;
#endif

Expand Down
Loading