Skip to content

Commit 82a0c1f

Browse files
committed
Replicate in Generals
1 parent 6193bb0 commit 82a0c1f

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,24 @@
3838

3939
enum ParticlePriorityType CPP_11(: Int);
4040

41-
#define MAX_LOD_PRESETS_PER_LEVEL 32 //number of hardware configs preset for each low,medium,high
41+
#define MAX_LOD_PRESETS_PER_LEVEL 32 //number of hardware configs preset for each low,medium,high,veryhigh
4242
#define MAX_BENCH_PROFILES 16
4343

4444
//Make sure this enum stays in sync with GameLODNames[]
4545
enum StaticGameLODLevel CPP_11(: Int)
4646
{
4747
STATIC_GAME_LOD_UNKNOWN=-1,
48+
4849
STATIC_GAME_LOD_LOW,
4950
STATIC_GAME_LOD_MEDIUM,
5051
STATIC_GAME_LOD_HIGH,
52+
STATIC_GAME_LOD_VERY_HIGH,
53+
5154
STATIC_GAME_LOD_CUSTOM, //make sure this remains last!
52-
STATIC_GAME_LOD_COUNT
55+
56+
STATIC_GAME_LOD_COUNT,
57+
STATIC_GAME_LOD_FIRST = 0,
58+
STATIC_GAME_LOD_LAST = STATIC_GAME_LOD_CUSTOM - 1,
5359
};
5460

5561
enum DynamicGameLODLevel CPP_11(: Int)
@@ -193,6 +199,7 @@ class GameLODManager
193199
BenchProfile m_benchProfiles[MAX_BENCH_PROFILES];
194200

195201
protected:
202+
void initStaticLODLevels();
196203
void applyStaticLODLevel(StaticGameLODLevel level);
197204
void applyDynamicLODLevel(DynamicGameLODLevel level);
198205
void refreshCustomStaticLODLevel(void); ///<grabs current globaldata values and makes them the custom detail setting.

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static const char *const StaticGameLODNames[]=
7676
"Low",
7777
"Medium",
7878
"High",
79+
"VeryHigh",
7980
"Custom"
8081
};
8182
static_assert(ARRAY_SIZE(StaticGameLODNames) == STATIC_GAME_LOD_COUNT, "Incorrect array size");
@@ -231,13 +232,44 @@ GameLODManager::GameLODManager(void)
231232

232233
for (Int i=0; i<STATIC_GAME_LOD_CUSTOM; i++)
233234
m_numLevelPresets[i]=0;
235+
236+
initStaticLODLevels();
234237
};
235238

236239
GameLODManager::~GameLODManager()
237240
{
238241

239242
}
240243

244+
void GameLODManager::initStaticLODLevels()
245+
{
246+
// TheSuperHackers @info Initialize new system specs in this function when we cannot rely on new edits to GameLOD.ini.
247+
248+
StaticGameLODInfo& veryhigh = m_staticGameLODInfo[STATIC_GAME_LOD_VERY_HIGH];
249+
veryhigh.m_minFPS = 55;
250+
veryhigh.m_minProcessorFPS = 59;
251+
veryhigh.m_sampleCount2D = 6;
252+
veryhigh.m_sampleCount3D = 24;
253+
veryhigh.m_streamCount = 2;
254+
veryhigh.m_maxParticleCount = 5000;
255+
veryhigh.m_useShadowVolumes = TRUE;
256+
veryhigh.m_useShadowDecals = TRUE;
257+
veryhigh.m_useCloudMap = TRUE;
258+
veryhigh.m_useLightMap = TRUE;
259+
veryhigh.m_showSoftWaterEdge = TRUE;
260+
veryhigh.m_maxTankTrackEdges = 100;
261+
veryhigh.m_maxTankTrackOpaqueEdges = 25;
262+
veryhigh.m_maxTankTrackFadeDelay = 60000;
263+
veryhigh.m_useBuildupScaffolds = TRUE;
264+
veryhigh.m_useTreeSway = TRUE;
265+
veryhigh.m_useEmissiveNightMaterials = TRUE;
266+
veryhigh.m_useHeatEffects = TRUE;
267+
veryhigh.m_textureReduction = 0;
268+
veryhigh.m_useFpsLimit = TRUE;
269+
veryhigh.m_enableDynamicLOD = TRUE;
270+
veryhigh.m_useTrees = TRUE;
271+
}
272+
241273
BenchProfile *GameLODManager::newBenchProfile(void)
242274
{
243275
if (m_numBenchProfiles < MAX_BENCH_PROFILES)
@@ -320,7 +352,7 @@ void GameLODManager::init(void)
320352
//Check if we're within 5% of the performance of this cpu profile.
321353
if (m_intBenchIndex/prof->m_intBenchIndex >= PROFILE_ERROR_LIMIT && m_floatBenchIndex/prof->m_floatBenchIndex >= PROFILE_ERROR_LIMIT && m_memBenchIndex/prof->m_memBenchIndex >= PROFILE_ERROR_LIMIT)
322354
{
323-
for (Int i=STATIC_GAME_LOD_HIGH; i >= STATIC_GAME_LOD_LOW; i--)
355+
for (Int i=STATIC_GAME_LOD_LAST; i >= STATIC_GAME_LOD_FIRST; i--)
324356
{
325357
LODPresetInfo *preset=&m_lodPresets[i][0]; //pointer to first preset at this LOD level.
326358
for (Int j=0; j<m_numLevelPresets[i]; j++)
@@ -456,7 +488,7 @@ StaticGameLODLevel GameLODManager::getRecommendedStaticLODLevel(void)
456488

457489
Int numMBRam=m_numRAM/(1024*1024);
458490

459-
for (Int i=STATIC_GAME_LOD_HIGH; i >= STATIC_GAME_LOD_LOW; i--)
491+
for (Int i=STATIC_GAME_LOD_LAST; i >= STATIC_GAME_LOD_FIRST; i--)
460492
{
461493
LODPresetInfo *preset=&m_lodPresets[i][0]; //pointer to first preset at this LOD level.
462494
for (Int j=0; j<m_numLevelPresets[i]; j++)

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,12 +1836,18 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
18361836

18371837
// set the display detail
18381838
// TheSuperHackers @tweak xezon 24/09/2025 The Detail Combo Box now has the same value order as StaticGameLODLevel for simplicity.
1839+
// TheSuperHackers @feature xezon 24/09/2025 The Detail Combo Box now has a new options for "Very High".
18391840
GadgetComboBoxReset(comboBoxDetail);
1841+
#if ENABLE_GUI_HACKS
1842+
// TheSuperHackers @tweak xezon 24/09/2025 Show max 4 rows because with the original layout it cannot possibly show 5.
1843+
GadgetComboBoxSetMaxDisplay(comboBoxDetail, 4);
1844+
#endif
18401845
GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Low"), color);
18411846
GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Medium"), color);
18421847
GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:High"), color);
1848+
GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->FETCH_OR_SUBSTITUTE("GUI:VeryHigh", L"Very High"), color);
18431849
GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Custom"), color);
1844-
static_assert(STATIC_GAME_LOD_COUNT == 4, "Wrong combo box count");
1850+
static_assert(STATIC_GAME_LOD_COUNT == 5, "Wrong combo box count");
18451851

18461852
//Check if level was never set and default to setting most suitable for system.
18471853
if (TheGameLODManager->getStaticLODLevel() == STATIC_GAME_LOD_UNKNOWN)

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,7 @@ StaticGameLODLevel W3DShaderManager::getGPUPerformanceIndex(void)
28552855
if (chipType >= DC_GEFORCE2)
28562856
detailSetting=STATIC_GAME_LOD_LOW; //these cards need multiple terrain passes.
28572857
if (chipType >= DC_GENERIC_PIXEL_SHADER_1_1) //these cards can do terrain in single pass.
2858-
detailSetting=STATIC_GAME_LOD_HIGH;
2858+
detailSetting=STATIC_GAME_LOD_VERY_HIGH;
28592859
}
28602860

28612861
return detailSetting;

0 commit comments

Comments
 (0)