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
fix(gamelod): let the detail setting choose the texture resolution
Olcay Seyganb78b47be6b5f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e12f2bc42..5989676c7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -336,6 +336,9 @@ found and fixed — EA's own, not port damage.**- The writing on screen grows with your monitor now. Every panel is stretched to your resolution and always was, but the text inside it stayed the size it was drawn at in 2003, and what growth there was stopped dead at twice - so on a 2560 wide screen a command bar three times its original size still wore eight point lettering. The keys on the build buttons, the prices and the build times were the worst of it: at 2K they were drawn, and unreadable.- The strip of everything your base is building follows the screen too, instead of staying a row of postage stamps under a command bar three times its size.- Widescreen resolutions are back in the options menu.+- Picking High detail gives you high resolution textures. The setting was ignored: the resolution came from a machine benchmark that answers 'low' on anything modern, so there was no way to ask for better.+- The Default button in the options menu no longer throws away your resolution. It reset the display along with everything else, dropping you to 800x600 with no undo.+- Text does not vanish at large sizes. Any font over 100 points simply failed to load, which on a 4K screen is a missing line of interface.- Zoom further out, with the whole map drawn instead of black corners.- The zoom-out ceiling is the same for everyone; no setting buys you a wider view.- The wheel covers that whole range in about six notches instead of thirty-eight.diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cppindex 72b5d4924..441f5fd65 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp@@ -555,8 +555,14 @@ void GameLODManager::applyStaticLODLevel(StaticGameLODLevel level)}elseif (level >= STATIC_GAME_LOD_LOW)- { //normal non-custom level gets texture reduction based on recommendation- requestedTextureReduction = getRecommendedTextureReduction();+ {+ // The level the player picked decides the texture resolution. It used to come from the+ // machine benchmark instead, and that benchmark answers "low" on any modern machine - so+ // choosing High still gave low resolution textures and nothing in the menu could raise+ // them. Under 256 MB is still forced down, which is what the memory test is for.+ requestedTextureReduction = m_memPassed+ ? getLevelTextureReduction(level)+ : getLevelTextureReduction(STATIC_GAME_LOD_LOW);}if (TheGlobalData)diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cppindex 24eb0bba3..d389f544e 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp@@ -949,9 +949,15 @@ static void setDefaults( void )// send DelayGadgetCheckBoxSetChecked(checkSendDelay, FALSE);+ // Default puts the *game* options back to their defaults. It used to reach into the display+ // settings too - re-running the machine benchmark and dropping the resolution to 800x600 - so+ // one click on a menu full of audio and control settings threw away a monitor's worth of+ // picture and there was no undo.+ const Bool modifyDisplaySettings = FALSE;+//-------------------------------------------------------------------------------------------------// LOD- if ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE)) {+ if (modifyDisplaySettings && ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE))) {StaticGameLODLevel level=TheGameLODManager->findStaticLODLevel();switch (level){@@ -975,7 +981,7 @@ static void setDefaults( void )//-------------------------------------------------------------------------------------------------// Resolution//Find index of 800x600 mode.- if ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE) && !TheGameSpyInfo) {+ if (modifyDisplaySettings && ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE) && !TheGameSpyInfo)) {Int numResolutions = TheDisplay->getDisplayModeCount();Int defaultResIndex=0;for( Int i = 0; i < numResolutions; ++i )diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cppindex 769398787..b9d42794e 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp@@ -79,7 +79,10 @@ Bool W3DFontLibrary::loadFontData( GameFont *font )if( font == NULL )return FALSE;- if ((UnsignedInt)font->pointSize > 100) //sanity check the size - anything over 100 is probably wrong. -MW+ // 100 points was "probably wrong" on a 1024x768 screen. On a 4K display the interface scales+ // past it and the font simply fails to load, which is a missing string on screen. A size of+ // zero is still refused - that one really is wrong.+ if (font->pointSize < 1)fontChar = NULL;else{ // get the font data from the asset manager