Skip to content

Commit 2fc7a53

Browse files
Chapter5780Chapter5780
authored andcommitted
Partial fix: terrain/water extents work for unlimited zoom, but guard mode shadow is missing
1 parent 026e633 commit 2fc7a53

File tree

7 files changed

+68
-9
lines changed

7 files changed

+68
-9
lines changed

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -606,17 +606,40 @@ Bool W3DTerrainVisual::load( AsciiString filename )
606606
// apply the heightmap to the terrain render object
607607

608608
#ifdef DO_SEISMIC_SIMULATIONS
609-
m_terrainRenderObject->initHeightData( m_clientHeightMap->getDrawWidth(),
610-
m_clientHeightMap->getDrawHeight(),
611-
m_clientHeightMap,
612-
it);
609+
610+
Int xExt = TheGlobalData->m_unlimitedzoom ? m_clientHeightMap->getXExtent() : m_clientHeightMap->getDrawWidth();
611+
612+
Int yExt = TheGlobalData->m_unlimitedzoom ? m_clientHeightMap->getYExtent() : m_clientHeightMap->getDrawHeight();
613+
614+
615+
616+
// this case fixes missing smooth water effects, but breaks guard move even further
617+
// it used to show in the bottom left tile, no it doesn't show anywhere
618+
// this is last bug prolly before i can upload it
619+
if (TheGlobalData->m_unlimitedzoom) {
620+
m_clientHeightMap->setDrawWidth(xExt);
621+
m_clientHeightMap->setDrawHeight(yExt);
622+
}
623+
624+
m_terrainRenderObject->initHeightData( xExt, yExt, m_clientHeightMap, it);
625+
613626
#else
614-
m_terrainRenderObject->initHeightData( m_logicHeightMap->getDrawWidth(),
615-
m_logicHeightMap->getDrawHeight(),
616-
m_logicHeightMap,
617-
it);
618-
#endif
619627

628+
Int xExt = TheGlobalData->m_unlimitedzoom ? m_logicHeightMap->getXExtent() : m_logicHeightMap->getDrawWidth();
629+
630+
Int yExt = TheGlobalData->m_unlimitedzoom ? m_logicHeightMap->getYExtent() : m_logicHeightMap->getDrawHeight();
631+
632+
if (TheGlobalData->m_unlimitedzoom) {
633+
634+
m_logicHeightMap->setDrawWidth(xExt);
635+
636+
m_logicHeightMap->setDrawHeight(yExt);
637+
638+
}
639+
640+
m_terrainRenderObject->initHeightData( xExt, yExt, m_logicHeightMap, it);
641+
642+
#endif
620643

621644
if (it) {
622645
W3DDisplay::m_3DScene->destroyLightsIterator(it);

Generals/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ class GlobalData : public SubsystemInterface
120120
// Run game without graphics, input or audio.
121121
Bool m_headless;
122122

123+
// TheSuperHackers @feature mirelle 05/02/2026
124+
// Enable unlimited terrain rendering distance.
125+
Bool m_unlimitedzoom;
126+
123127
Bool m_windowed;
124128
Int m_xResolution;
125129
Int m_yResolution;

Generals/Code/GameEngine/Source/Common/CommandLine.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ Int parseNoVideo(char *args[], int)
141141
return 1;
142142
}
143143

144+
//=============================================================================
145+
//=============================================================================
146+
Int parseUnlimitedZoom(char *args[], int)
147+
{
148+
TheWritableGlobalData->m_unlimitedzoom = true;
149+
150+
return 1;
151+
}
152+
144153
//=============================================================================
145154
//=============================================================================
146155
Int parseFPUPreserve(char *args[], int argc)
@@ -1183,6 +1192,10 @@ static CommandLineParam paramsForEngineInit[] =
11831192
// TheSuperHackers @feature xezon 03/08/2025 Force full viewport for 'Control Bar Pro' Addons like GenTool did it.
11841193
{ "-forcefullviewport", parseFullViewport },
11851194

1195+
// TheSuperHackers @feature mirelle 05/02/2026
1196+
// Enable unlimited terrain rendering distance.
1197+
{ "-unlimitedzoom", parseUnlimitedZoom },
1198+
11861199
#if defined(RTS_DEBUG)
11871200
{ "-noaudio", parseNoAudio },
11881201
{ "-map", parseMapName },

Generals/Code/GameEngine/Source/Common/GlobalData.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ GlobalData::GlobalData()
627627
m_framesPerSecondLimit = 0;
628628
m_chipSetType = 0;
629629
m_headless = FALSE;
630+
m_unlimitedzoom = FALSE;
630631
m_windowed = 0;
631632
m_xResolution = DEFAULT_DISPLAY_WIDTH;
632633
m_yResolution = DEFAULT_DISPLAY_HEIGHT;

GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ class GlobalData : public SubsystemInterface
121121
// Run game without graphics, input or audio.
122122
Bool m_headless;
123123

124+
// TheSuperHackers @feature mirelle 05/02/2026
125+
// Enable unlimited terrain rendering distance.
126+
Bool m_unlimitedzoom;
127+
124128
Bool m_windowed;
125129
Int m_xResolution;
126130
Int m_yResolution;

GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ Int parseNoVideo(char *args[], int)
141141
return 1;
142142
}
143143

144+
//=============================================================================
145+
//=============================================================================
146+
Int parseUnlimitedZoom(char *args[], int)
147+
{
148+
TheWritableGlobalData->m_unlimitedzoom = true;
149+
150+
return 1;
151+
}
152+
144153
//=============================================================================
145154
//=============================================================================
146155
Int parseFPUPreserve(char *args[], int argc)
@@ -1183,6 +1192,10 @@ static CommandLineParam paramsForEngineInit[] =
11831192
// TheSuperHackers @feature xezon 03/08/2025 Force full viewport for 'Control Bar Pro' Addons like GenTool did it.
11841193
{ "-forcefullviewport", parseFullViewport },
11851194

1195+
// TheSuperHackers @feature mirelle 05/02/2026
1196+
// Enable unlimited terrain rendering distance.
1197+
{ "-unlimitedzoom", parseUnlimitedZoom },
1198+
11861199
#if defined(RTS_DEBUG)
11871200
{ "-noaudio", parseNoAudio },
11881201
{ "-map", parseMapName },

GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ GlobalData::GlobalData()
631631
m_framesPerSecondLimit = 0;
632632
m_chipSetType = 0;
633633
m_headless = FALSE;
634+
m_unlimitedzoom = FALSE;
634635
m_windowed = 0;
635636
m_xResolution = DEFAULT_DISPLAY_WIDTH;
636637
m_yResolution = DEFAULT_DISPLAY_HEIGHT;

0 commit comments

Comments
 (0)