Skip to content

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.

fix(w3ddevice): no hud plates over the loading screen

Olcay Seygan5496017311b7
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 3bfcb4d68..ddcf1aa38 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -11843,7 +11843,8 @@ void InGameUI::drawCellGridFront( Int grid )
Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Int panelCount )
{
m_controlBarPageShown = FALSE;
- if( TheGameLogic == NULL || !TheGameLogic->isInGame() || TheGameLogic->isInShellGame() )
+ // nor while the map loads: the load screen is painted by the window repaint this page rides on
+ if( TheGameLogic == NULL || !TheGameLogic->isInGame() || TheGameLogic->isInShellGame() || TheGlobalData->m_loadScreenRender )
{
TheControlBar->setPageSolids( NULL );
return FALSE;
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
index d8babbba2..5c9a5a911 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
@@ -477,7 +477,12 @@ void W3DInGameUI::draw( void )
QueryPerformanceCounter( (LARGE_INTEGER *)&tPostStart );
#endif
- postDraw();
+ // While the map loads the display calls this every pass to paint the load screen's windows, and
+ // the match is already "in game" with its peace time set: the truce plate, the corner readout and
+ // the strips drew over the load screen. Only the windows belong there.
+ const Bool matchOnScreen = !TheGlobalData->m_loadScreenRender;
+ if( matchOnScreen )
+ postDraw();
#ifdef DEBUG_LOGGING
QueryPerformanceCounter( (LARGE_INTEGER *)&tPostEnd );
@@ -502,9 +507,12 @@ void W3DInGameUI::draw( void )
// the one reading you want visible exactly when something is going wrong.
//
// the peace time clock across the top middle, and the clock plate in the corner beside it
- drawPeaceTimer();
- drawHudOverlay();
- drawScoreboard();
+ if( matchOnScreen )
+ {
+ drawPeaceTimer();
+ drawHudOverlay();
+ drawScoreboard();
+ }
#ifdef EXTENDED_STATS
}