From ed16bbacaa00fd233ab3b77618ad0128c2db1b64 Mon Sep 17 00:00:00 2001 From: "Salem B." Date: Mon, 19 Jan 2026 18:47:06 +0100 Subject: [PATCH 1/3] bugfix(worldbuilder): Fixes window-resizing crash in Generals - fixes #2008 - Note 1: This issue only affects Generals but not Zero Hour - Note 2: Crash happens When Switching from one Window size to another (#2008), Brought the logic to be the exact same as in the generals zero-hour WorldBuilder which is known to work without crashing: Removing shutdown and reinit appears to resolve the issue. When shutting down and reinitializing the device might not be ready yet by the time the call is made again to Wd3ShaderManager::init() and this causes the Generals WorldBuilder to crash when resizing from a resolution to another and then back to that resolution again. nullpointer checks inside the init function didnot help alleviate the issue - See Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp and GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp for more information --- Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index d4c2235c5fb..5b167390125 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -573,10 +573,18 @@ void WbView3d::reset3dEngineDisplaySize(Int width, Int height) bogusTacticalView.setOrigin(0,0); m_actualWinSize.x = width; m_actualWinSize.y = height; + // TheSuperHackers @bugfix jurassiclizard 19/01/2026 Fix Generals World-builder Crash + // when Switching from one Window size to another (#2008), Brought the logic to be the exact same + // as in the generals zero-hour WorldBuilder which is known to work without crashing: Removing shutdown and reinit + // appears to resolve the issue. + // When shutting down and reinitializing the device might not be ready yet by the time + // the call is made again to Wd3ShaderManager::init() and this causes the Generals WorldBuilder to crash + // when resizing from a resolution to another and then back to that resolution again. + // nullpointer checks inside the init function didnot help alleviate the issue + // See Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp and + // GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp for more information if (m_ww3dInited) { - W3DShaderManager::shutdown(); WW3D::Set_Device_Resolution(m_actualWinSize.x, m_actualWinSize.y, true); - W3DShaderManager::init(); } } From 7c36f38794fdd61d2f24738eddde4a8905f14d38 Mon Sep 17 00:00:00 2001 From: "Salem B." Date: Mon, 19 Jan 2026 18:59:03 +0100 Subject: [PATCH 2/3] update comment --- Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index 5b167390125..0cc56b57f15 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -576,7 +576,7 @@ void WbView3d::reset3dEngineDisplaySize(Int width, Int height) // TheSuperHackers @bugfix jurassiclizard 19/01/2026 Fix Generals World-builder Crash // when Switching from one Window size to another (#2008), Brought the logic to be the exact same // as in the generals zero-hour WorldBuilder which is known to work without crashing: Removing shutdown and reinit - // appears to resolve the issue. + // when resetting the device resolution appears to resolve the issue. // When shutting down and reinitializing the device might not be ready yet by the time // the call is made again to Wd3ShaderManager::init() and this causes the Generals WorldBuilder to crash // when resizing from a resolution to another and then back to that resolution again. From 46ea36659a3156869bfabc5433b084bb350e622b Mon Sep 17 00:00:00 2001 From: "Salem B." Date: Mon, 19 Jan 2026 19:45:37 +0100 Subject: [PATCH 3/3] Remove redundant comment --- Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index 0cc56b57f15..97f571864f9 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -573,16 +573,6 @@ void WbView3d::reset3dEngineDisplaySize(Int width, Int height) bogusTacticalView.setOrigin(0,0); m_actualWinSize.x = width; m_actualWinSize.y = height; - // TheSuperHackers @bugfix jurassiclizard 19/01/2026 Fix Generals World-builder Crash - // when Switching from one Window size to another (#2008), Brought the logic to be the exact same - // as in the generals zero-hour WorldBuilder which is known to work without crashing: Removing shutdown and reinit - // when resetting the device resolution appears to resolve the issue. - // When shutting down and reinitializing the device might not be ready yet by the time - // the call is made again to Wd3ShaderManager::init() and this causes the Generals WorldBuilder to crash - // when resizing from a resolution to another and then back to that resolution again. - // nullpointer checks inside the init function didnot help alleviate the issue - // See Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp and - // GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp for more information if (m_ww3dInited) { WW3D::Set_Device_Resolution(m_actualWinSize.x, m_actualWinSize.y, true); }