Skip to content

Commit 3e96876

Browse files
committed
Move DX8Wrapper_IsWindowed headless fix into parseHeadless function
1 parent 3d8ef9e commit 3e96876

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,13 @@ Int parseHeadless(char *args[], int num)
414414
TheWritableGlobalData->m_playIntro = FALSE;
415415
TheWritableGlobalData->m_afterIntro = TRUE;
416416
TheWritableGlobalData->m_playSizzle = FALSE;
417+
418+
// TheSuperHackers @fix bobtista 03/02/2026 Set DX8Wrapper_IsWindowed to false in headless
419+
// mode so that ignoringAsserts() works correctly throughout the entire process lifetime,
420+
// including during shutdown after TheGlobalData has been destroyed.
421+
extern bool DX8Wrapper_IsWindowed;
422+
DX8Wrapper_IsWindowed = false;
423+
417424
return 1;
418425
}
419426

GeneralsMD/Code/Main/WinMain.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -875,18 +875,8 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
875875
#endif
876876

877877
// register windows class and create application window
878-
// TheSuperHackers @fix bobtista 03/02/2026 Set DX8Wrapper_IsWindowed to false in headless
879-
// mode so that ignoringAsserts() works correctly throughout the entire process lifetime,
880-
// including during shutdown after TheGlobalData has been destroyed.
881-
if (TheGlobalData->m_headless)
882-
{
883-
extern bool DX8Wrapper_IsWindowed;
884-
DX8Wrapper_IsWindowed = false;
885-
}
886-
else if (initializeAppWindows(hInstance, nCmdShow, TheGlobalData->m_windowed) == false)
887-
{
878+
if(!TheGlobalData->m_headless && initializeAppWindows(hInstance, nCmdShow, TheGlobalData->m_windowed) == false)
888879
return exitcode;
889-
}
890880

891881
// save our application instance for future use
892882
ApplicationHInstance = hInstance;

0 commit comments

Comments
 (0)