Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Sep 25, 2025

This change simplifies the game detail setup for the Options Menu.

This is mostly a refactor, but user facing the order of the Graphics Detail options changes from

  • High
  • Medium
  • Low
  • Custom

to

  • Low
  • Medium
  • High
  • Custom

Additionally findStaticLODLevel was renamed to getRecommendedStaticLODLevel because that is a better name for it and makes it less confusing to getStaticLODLevel

TODO

  • Replicate in Generals

@xezon xezon added GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing labels Sep 25, 2025
Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@xezon xezon force-pushed the xezon/gamelod-1-refactor-setup branch from 0666ff0 to 06854ba Compare October 11, 2025 11:24
@xezon
Copy link
Author

xezon commented Oct 11, 2025

Replicated in Generals with 1 conflict

D:\Projects\TheSuperHackers\GeneralsGameCode>FOR /F "delims=" %b IN ('git merge-base --fork-point main') DO git diff %b  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git diff 6c9a97596a819df9d278bd6e7e93e81d7bdc98f8  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git apply -p2 --directory=Generals --reject --whitespace=fix changes.patch
changes.patch:102: space before tab in indent.
                //-------------------------------------------------------------------------------------------------
changes.patch:103: space before tab in indent.
                // Texture resolution slider
Checking patch Generals/Code/GameEngine/Include/Common/GameLOD.h...
Hunk #1 succeeded at 163 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Source/Common/GameLOD.cpp...
Hunk #1 succeeded at 441 (offset -4 lines).
Hunk #2 succeeded at 687 (offset -5 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp...
Hunk #1 succeeded at 208 (offset -9 lines).
error: while searching for:

        //-------------------------------------------------------------------------------------------------
        // LOD
        if ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE)) {
                StaticGameLODLevel level=TheGameLODManager->findStaticLODLevel();
                switch (level)
                {
                case STATIC_GAME_LOD_LOW:
                        GadgetComboBoxSetSelectedPos(comboBoxDetail, LOWDETAIL);
                        break;
                case STATIC_GAME_LOD_MEDIUM:
                        GadgetComboBoxSetSelectedPos(comboBoxDetail, MEDIUMDETAIL);
                        break;
                case STATIC_GAME_LOD_HIGH:
                        GadgetComboBoxSetSelectedPos(comboBoxDetail, HIGHDETAIL);
                        break;
                case STATIC_GAME_LOD_CUSTOM:
                        GadgetComboBoxSetSelectedPos(comboBoxDetail, CUSTOMDETAIL);
                        break;
                default:
                        DEBUG_ASSERTCRASH(FALSE,("Tried to set comboBoxDetail to a value of %d ", TheGameLODManager->getStaticLODLevel()) );
                };
        }

        //-------------------------------------------------------------------------------------------------

error: patch failed: Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp:990
Hunk #3 succeeded at 1123 (offset -35 lines).
Hunk #4 succeeded at 1192 (offset -38 lines).
Hunk #5 succeeded at 1540 (offset -44 lines).
Hunk #6 succeeded at 1851 (offset -51 lines).
Hunk #7 succeeded at 2183 (offset -55 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp...
Hunk #1 succeeded at 741 (offset -159 lines).
Hunk #2 succeeded at 1715 (offset -265 lines).
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp...
Hunk #1 succeeded at 741 (offset -50 lines).
Applied patch Generals/Code/GameEngine/Include/Common/GameLOD.h cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/GameLOD.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Hunk #5 applied cleanly.
Hunk #6 applied cleanly.
Hunk #7 applied cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp cleanly.
Applied patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp cleanly.

@xezon xezon merged commit 9e42e59 into TheSuperHackers:main Oct 11, 2025
18 checks passed
@xezon xezon deleted the xezon/gamelod-1-refactor-setup branch October 11, 2025 19:48
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants