Skip to content

Conversation

@L3-M
Copy link

@L3-M L3-M commented Nov 3, 2025

This change fixes a crash when RenderFpsFontSize = 0 in Generals and Zero Hour.

@L3-M L3-M self-assigned this Nov 3, 2025
@L3-M L3-M added Critical Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour ThisProject The issue was introduced by this project, or this task is specific to this project Crash This is a crash, very bad labels Nov 3, 2025
@xezon
Copy link

xezon commented Nov 3, 2025

What was the crash call stack?

@L3-M
Copy link
Author

L3-M commented Nov 3, 2025

What was the crash call stack?

 >	generalszh.exe!FontCharsClass::Store_GDI_Char(wchar_t ch) Line 1391	C++
 	generalszh.exe!FontCharsClass::Get_Char_Data(wchar_t ch) Line 1256	C++
 	generalszh.exe!FontCharsClass::Get_Char_Spacing(wchar_t ch) Line 1289	C++
 	generalszh.exe!Render2DSentenceClass::Allocate_New_Surface(const wchar_t * text, bool justCalcExtents) Line 645	C++
 	generalszh.exe!Render2DSentenceClass::Build_Sentence_Not_Centered(const wchar_t * text, int * hkX, int * hkY, bool justCalcExtents) Line 1005	C++
 	generalszh.exe!Render2DSentenceClass::Get_Formatted_Text_Extents(const wchar_t * text) Line 289	C++
 	generalszh.exe!W3DDisplayString::computeExtents() Line 362	C++
 	generalszh.exe!W3DDisplayString::setFont(GameFont * font) Line 308	C++
 	generalszh.exe!InGameUI::refreshRenderFpsResources() Line 5947	C++
 	generalszh.exe!InGameUI::refreshCustomUiResources() Line 5909	C++
 	generalszh.exe!InGameUI::reset() Line 2071	C++
 	generalszh.exe!W3DInGameUI::reset() Line 381	C++
 	generalszh.exe!GameClient::reset() Line 457	C++
 	generalszh.exe!W3DGameClient::reset() Line 106	C++
 	generalszh.exe!SubsystemInterfaceList::resetAll() Line 183	C++
 	generalszh.exe!GameEngine::resetSubsystems() Line 812	C++
 	generalszh.exe!GameEngine::init() Line 769	C++
 	generalszh.exe!Win32GameEngine::init() Line 66	C++
 	generalszh.exe!GameMain() Line 46	C++
 	generalszh.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 903	C++
 	[External Code]	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	

@xezon
Copy link

xezon commented Nov 3, 2025

Ok. We probably want to make another change where Store_GDI_Char does not crash on 0 font, but raises Assert instead.

@xezon xezon changed the title bugfix(ui): Fix crash when RenderFpsFontSize is set to 0 bugfix(gui): Fix crash when RenderFpsFontSize is set to 0 Nov 3, 2025
@xezon xezon merged commit 38a4202 into TheSuperHackers:main Nov 3, 2025
18 checks passed
@L3-M L3-M deleted the L3-M/fix-renderfps-crash branch November 3, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Crash This is a crash, very bad Critical Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ThisProject The issue was introduced by this project, or this task is specific to this project ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants