Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
refactor(gameengine): remove the dead m_useWaterPlane
Olcay Seygand3fde22c09d4
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex a6dfe70c9..35367c34b 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -190,7 +190,6 @@ public:Bool m_clientRetaliationModeEnabled;Bool m_doubleClickAttackMove;Bool m_rightMouseAlwaysScrolls;- Bool m_useWaterPlane;Bool m_useCloudPlane;Bool m_useShadowVolumes;Bool m_useShadowVolumesForSkins; // "UseShadowVolumesForSkins": also cast volume shadows off skinned meshesdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cppindex 30358b9eb..788d14e51 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp@@ -72,6 +72,12 @@ GlobalData* TheWritableGlobalData = NULL; ///< The global data singleton//-------------------------------------------------------------------------------------------------GlobalData* GlobalData::m_theOriginal = NULL;+// A key the shipped GameData.ini still carries but nothing reads. It has to stay in the table,+// because an unknown key throws, so it is parsed into nothing.+static void parseIgnoredField( INI *, void *, void *, const void * )+{+}+///////////////////////////////////////////////////////////////////////////////////////////////////// PRIVATE DATA //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@@ -103,7 +109,7 @@ GlobalData* GlobalData::m_theOriginal = NULL;{ "TerrainLOD", INI::parseIndexList, TerrainLODNames, offsetof( GlobalData, m_terrainLOD ) },{ "TerrainLODTargetTimeMS", INI::parseInt, NULL, offsetof( GlobalData, m_terrainLODTargetTimeMS ) },{ "RightMouseAlwaysScrolls", INI::parseBool, NULL, offsetof( GlobalData, m_rightMouseAlwaysScrolls ) },- { "UseWaterPlane", INI::parseBool, NULL, offsetof( GlobalData, m_useWaterPlane ) },+ { "UseWaterPlane", parseIgnoredField, NULL, 0 },{ "UseCloudPlane", INI::parseBool, NULL, offsetof( GlobalData, m_useCloudPlane ) },{ "DownwindAngle", INI::parseReal, NULL, offsetof( GlobalData, m_downwindAngle ) },{ "UseShadowVolumes", INI::parseBool, NULL, offsetof( GlobalData, m_useShadowVolumes ) },@@ -677,7 +683,6 @@ GlobalData::GlobalData()m_enableDynamicLOD = TRUE;m_enableStaticLOD = TRUE;m_rightMouseAlwaysScrolls = FALSE;- m_useWaterPlane = FALSE;m_useCloudPlane = FALSE;m_downwindAngle = ( -0.785f );//Northeast!m_useShadowVolumes = FALSE;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex 6155be275..6010a73da 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -4926,7 +4926,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage//-----------------------------------------------------------------------------------------case GameMessage::MSG_META_DEMO_TOGGLE_WATERPLANE:{- TheWritableGlobalData->m_useWaterPlane = !TheGlobalData->m_useWaterPlane;+ // The water plane it toggled is gone; the message is kept so the enum does not shift.disp = DESTROY_MESSAGE;break;}diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cppindex a63d13621..50f8ec54c 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp@@ -1106,44 +1106,37 @@ void HeightMapRenderObjClass::adjustTerrainLOD(Int adj)switch (TheGlobalData->m_terrainLOD) {case TERRAIN_LOD_MIN: TheWritableGlobalData->m_useCloudMap = false;TheWritableGlobalData->m_useLightMap = false ;- TheWritableGlobalData->m_useWaterPlane = false;TheWritableGlobalData->m_stretchTerrain = false;TheWritableGlobalData->m_useHalfHeightMap = true;break;case TERRAIN_LOD_HALF_CLOUDS: TheWritableGlobalData->m_useCloudMap = true;TheWritableGlobalData->m_useLightMap = true;- TheWritableGlobalData->m_useWaterPlane = false;TheWritableGlobalData->m_stretchTerrain = false;TheWritableGlobalData->m_useHalfHeightMap = true;break;case TERRAIN_LOD_STRETCH_NO_CLOUDS: TheWritableGlobalData->m_useCloudMap = false;TheWritableGlobalData->m_useLightMap = false;- TheWritableGlobalData->m_useWaterPlane = false;TheWritableGlobalData->m_stretchTerrain = true;TheWritableGlobalData->m_useHalfHeightMap = false;break;case TERRAIN_LOD_STRETCH_CLOUDS: TheWritableGlobalData->m_useCloudMap = true;TheWritableGlobalData->m_useLightMap = true;- TheWritableGlobalData->m_useWaterPlane = false;TheWritableGlobalData->m_stretchTerrain = true;TheWritableGlobalData->m_useHalfHeightMap = false;break;case TERRAIN_LOD_NO_CLOUDS: TheWritableGlobalData->m_useCloudMap = false;TheWritableGlobalData->m_useLightMap = false;- TheWritableGlobalData->m_useWaterPlane = false;TheWritableGlobalData->m_stretchTerrain = false;TheWritableGlobalData->m_useHalfHeightMap = false;break;default:case TERRAIN_LOD_NO_WATER: TheWritableGlobalData->m_useCloudMap = true;TheWritableGlobalData->m_useLightMap = true;- TheWritableGlobalData->m_useWaterPlane = false;TheWritableGlobalData->m_stretchTerrain = false;TheWritableGlobalData->m_useHalfHeightMap = false;break;case TERRAIN_LOD_MAX: TheWritableGlobalData->m_useCloudMap = true;TheWritableGlobalData->m_useLightMap = true;- TheWritableGlobalData->m_useWaterPlane = true;TheWritableGlobalData->m_stretchTerrain = false;TheWritableGlobalData->m_useHalfHeightMap = false;break;diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cppindex 0c9b39cac..ba8591dc0 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp@@ -1878,36 +1878,6 @@ void WaterRenderObjClass::Render(RenderInfoClass & rinfo)/*************************************************************************************/#endif- #if 0 // No longer do simple rendering.- if (TheGlobalData->m_useWaterPlane)- {- //@todo : Would it be better to create a new camera or change the transform of the- //existing one?- rinfo.Camera.Set_Transform( reflectedTransform );- rinfo.Camera.Apply(); //force an update of all the camera dependent parameters like frustum clip planes-- if(m_useCloudLayer)- {- if (TheGlobalData && TheGlobalData->m_drawEntireTerrain)- m_skyBox->Render(rinfo);- else- {- renderSky();- if (m_tod == TIME_OF_DAY_NIGHT)- renderSkyBody(&reflectedTransform);- }- }-- WW3D::Render(m_parentScene,&rinfo.Camera);-- rinfo.Camera.Set_Transform(OldCameraMatrix); //restore original non-reflected matrix- rinfo.Camera.Apply(); //force an update of all the camera dependent parameters like frustum clip planes-- //clear the z-buffer to remove changes made by objects inside mirror- DX8Wrapper::Clear(false,true,Vector3(0.1f,0.1f,0.1f));- }- #endif-#ifdef CLIP_GEOMETRY_TO_PLANE//restore default culling mode// DX8Wrapper::Set_DX8_Render_State(D3DRS_CLIPPLANEENABLE, 0 ); //turn off first clip plane