@@ -208,14 +208,6 @@ extern void DoResolutionDialog();
208208static Bool ignoreSelected = FALSE ;
209209WindowLayout *OptionsLayout = NULL ;
210210
211- enum Detail CPP_11 (: Int)
212- {
213- HIGHDETAIL = 0 ,
214- MEDIUMDETAIL,
215- LOWDETAIL,
216- CUSTOMDETAIL,
217- };
218-
219211
220212OptionPreferences::OptionPreferences ( void )
221213{
@@ -946,25 +938,9 @@ static void setDefaults( void )
946938
947939 // -------------------------------------------------------------------------------------------------
948940 // LOD
949- if ((TheGameLogic->isInGame () == FALSE ) || (TheGameLogic->isInShellGame () == TRUE )) {
950- TheGameLODManager->setStaticLODLevel (TheGameLODManager->findStaticLODLevel ());
951- switch (TheGameLODManager->getStaticLODLevel ())
952- {
953- case STATIC_GAME_LOD_LOW:
954- GadgetComboBoxSetSelectedPos (comboBoxDetail, LOWDETAIL);
955- break ;
956- case STATIC_GAME_LOD_MEDIUM:
957- GadgetComboBoxSetSelectedPos (comboBoxDetail, MEDIUMDETAIL);
958- break ;
959- case STATIC_GAME_LOD_HIGH:
960- GadgetComboBoxSetSelectedPos (comboBoxDetail, HIGHDETAIL);
961- break ;
962- case STATIC_GAME_LOD_CUSTOM:
963- GadgetComboBoxSetSelectedPos (comboBoxDetail, CUSTOMDETAIL);
964- break ;
965- default :
966- DEBUG_ASSERTCRASH (FALSE ,(" Tried to set comboBoxDetail to a value of %d " , TheGameLODManager->getStaticLODLevel ()) );
967- };
941+ if ((TheGameLogic->isInGame () == FALSE ) || (TheGameLogic->isInShellGame () == TRUE ))
942+ {
943+ GadgetComboBoxSetSelectedPos (comboBoxDetail, (Int)TheGameLODManager->getRecommendedStaticLODLevel ());
968944 }
969945
970946 // -------------------------------------------------------------------------------------------------
@@ -1131,7 +1107,7 @@ static void saveOptions( void )
11311107 // -------------------------------------------------------------------------------------------------
11321108 // Custom game detail settings.
11331109 GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
1134- if (index == CUSTOMDETAIL )
1110+ if (index == STATIC_GAME_LOD_CUSTOM )
11351111 {
11361112 // -------------------------------------------------------------------------------------------------
11371113 // Texture resolution slider
@@ -1200,27 +1176,8 @@ static void saveOptions( void )
12001176 // LOD
12011177 if (comboBoxDetail && comboBoxDetail->winGetEnabled ())
12021178 {
1203- Bool levelChanged=FALSE ;
12041179 GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
1205-
1206- // The levels stored by the LOD Manager are inverted compared to GUI so find correct one:
1207- switch (index) {
1208- case HIGHDETAIL:
1209- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_HIGH);
1210- break ;
1211- case MEDIUMDETAIL:
1212- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_MEDIUM);
1213- break ;
1214- case LOWDETAIL:
1215- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_LOW);
1216- break ;
1217- case CUSTOMDETAIL:
1218- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_CUSTOM);
1219- break ;
1220- default :
1221- DEBUG_ASSERTCRASH (FALSE ,(" LOD passed in was %d, %d is not a supported LOD" ,index,index));
1222- break ;
1223- }
1180+ const Bool levelChanged = TheGameLODManager->setStaticLODLevel ((StaticGameLODLevel)index);
12241181
12251182 if (levelChanged)
12261183 (*pref)[" StaticGameLOD" ] = TheGameLODManager->getStaticGameLODLevelName (TheGameLODManager->getStaticLODLevel ());
@@ -1567,23 +1524,7 @@ static void acceptAdvancedOptions()
15671524static void cancelAdvancedOptions ()
15681525{
15691526 // restore the detail selection back to initial state
1570- switch (TheGameLODManager->getStaticLODLevel ())
1571- {
1572- case STATIC_GAME_LOD_LOW:
1573- GadgetComboBoxSetSelectedPos (comboBoxDetail, LOWDETAIL);
1574- break ;
1575- case STATIC_GAME_LOD_MEDIUM:
1576- GadgetComboBoxSetSelectedPos (comboBoxDetail, MEDIUMDETAIL);
1577- break ;
1578- case STATIC_GAME_LOD_HIGH:
1579- GadgetComboBoxSetSelectedPos (comboBoxDetail, HIGHDETAIL);
1580- break ;
1581- case STATIC_GAME_LOD_CUSTOM:
1582- GadgetComboBoxSetSelectedPos (comboBoxDetail, CUSTOMDETAIL);
1583- break ;
1584- default :
1585- DEBUG_ASSERTCRASH (FALSE ,(" Tried to set comboBoxDetail to a value of %d " , TheGameLODManager->getStaticLODLevel ()) );
1586- };
1527+ GadgetComboBoxSetSelectedPos (comboBoxDetail, (Int)TheGameLODManager->getStaticLODLevel ());
15871528
15881529 WinAdvancedDisplay->winHide (TRUE );
15891530}
@@ -1894,35 +1835,22 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
18941835 GadgetComboBoxSetSelectedPos ( comboBoxResolution, selectedResIndex );
18951836
18961837 // set the display detail
1838+ // TheSuperHackers @tweak xezon 24/09/2025 The Detail Combo Box now has the same value order as StaticGameLODLevel for simplicity.
18971839 GadgetComboBoxReset (comboBoxDetail);
1898- GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:High" ), color);
1899- GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Medium" ), color);
19001840 GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Low" ), color);
1841+ GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Medium" ), color);
1842+ GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:High" ), color);
19011843 GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Custom" ), color);
1844+ static_assert (STATIC_GAME_LOD_COUNT == 4 , " Wrong combo box count" );
19021845
19031846 // Check if level was never set and default to setting most suitable for system.
19041847 if (TheGameLODManager->getStaticLODLevel () == STATIC_GAME_LOD_UNKNOWN)
1905- TheGameLODManager->setStaticLODLevel (TheGameLODManager->findStaticLODLevel ());
1906-
1907- switch (TheGameLODManager->getStaticLODLevel ())
1908- {
1909- case STATIC_GAME_LOD_LOW:
1910- GadgetComboBoxSetSelectedPos (comboBoxDetail, LOWDETAIL);
1911- break ;
1912- case STATIC_GAME_LOD_MEDIUM:
1913- GadgetComboBoxSetSelectedPos (comboBoxDetail, MEDIUMDETAIL);
1914- break ;
1915- case STATIC_GAME_LOD_HIGH:
1916- GadgetComboBoxSetSelectedPos (comboBoxDetail, HIGHDETAIL);
1917- break ;
1918- case STATIC_GAME_LOD_CUSTOM:
1919- GadgetComboBoxSetSelectedPos (comboBoxDetail, CUSTOMDETAIL);
1920- break ;
1921- default :
1922- DEBUG_ASSERTCRASH (FALSE ,(" Tried to set comboBoxDetail to a value of %d " , TheGameLODManager->getStaticLODLevel ()) );
1923- };
1848+ {
1849+ TheGameLODManager->setStaticLODLevel (TheGameLODManager->getRecommendedStaticLODLevel ());
1850+ }
19241851
19251852 Int txtFact=TheGameLODManager->getCurrentTextureReduction ();
1853+ GadgetComboBoxSetSelectedPos (comboBoxDetail, (Int)TheGameLODManager->getStaticLODLevel ());
19261854
19271855 GadgetSliderSetPosition ( sliderTextureResolution, 2 -txtFact);
19281856
@@ -2239,7 +2167,7 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
22392167 {
22402168 Int index;
22412169 GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
2242- if (index != CUSTOMDETAIL )
2170+ if (index != STATIC_GAME_LOD_CUSTOM )
22432171 break ;
22442172
22452173 showAdvancedOptions ();
0 commit comments