File tree Expand file tree Collapse file tree 5 files changed +22
-20
lines changed
Core/Libraries/Source/WWVegas/WW3D2
GameEngineDevice/Source/W3DDevice/GameClient/GUI
GameEngine/Source/GameClient/GUI
GameEngineDevice/Source/W3DDevice/GameClient/GUI
GameEngine/Source/GameClient/GUI Expand file tree Collapse file tree 5 files changed +22
-20
lines changed Original file line number Diff line number Diff line change @@ -1507,6 +1507,8 @@ FontCharsClass::Update_Current_Buffer (int char_width)
15071507void
15081508FontCharsClass::Create_GDI_Font (const char *font_name)
15091509{
1510+ WWASSERT (PointSize > 0 );
1511+
15101512 HDC screen_dc = ::GetDC ((HWND)WW3D::Get_Window ());
15111513
15121514 const char *fontToUseForGenerals = " Arial" ;
Original file line number Diff line number Diff line change @@ -178,6 +178,13 @@ void FontLibrary::reset( void )
178178// -------------------------------------------------------------------------------------------------
179179GameFont *FontLibrary::getFont ( AsciiString name, Int pointSize, Bool bold )
180180{
181+ // sanity check the size - anything over 100 is probably wrong. -MW
182+ // TheSuperHackers @fix Now also no longer creates fonts with zero size.
183+ if (pointSize < 1 || pointSize > 100 )
184+ {
185+ return NULL ;
186+ }
187+
181188 GameFont *font;
182189
183190 // search for font in list
Original file line number Diff line number Diff line change 7373// =============================================================================
7474Bool W3DFontLibrary::loadFontData ( GameFont *font )
7575{
76- FontCharsClass *fontChar;
77-
7876 // sanity
7977 if ( font == NULL )
8078 return FALSE ;
8179
82- if ((UnsignedInt)font->pointSize > 100 ) // sanity check the size - anything over 100 is probably wrong. -MW
83- fontChar = NULL ;
84- else
85- { // get the font data from the asset manager
86- fontChar = WW3DAssetManager::
87- Get_Instance ()->Get_FontChars ( font->nameString .str (), font->pointSize ,
88- font->bold ? true : false );
89- }
80+ // get the font data from the asset manager
81+ FontCharsClass *fontChar = WW3DAssetManager::Get_Instance ()->Get_FontChars (
82+ font->nameString .str (), font->pointSize , font->bold ? true : false );
9083
9184 if ( fontChar == NULL )
9285 {
Original file line number Diff line number Diff line change @@ -178,6 +178,13 @@ void FontLibrary::reset( void )
178178// -------------------------------------------------------------------------------------------------
179179GameFont *FontLibrary::getFont ( AsciiString name, Int pointSize, Bool bold )
180180{
181+ // sanity check the size - anything over 100 is probably wrong. -MW
182+ // TheSuperHackers @fix Now also no longer creates fonts with zero size.
183+ if (pointSize < 1 || pointSize > 100 )
184+ {
185+ return NULL ;
186+ }
187+
181188 GameFont *font;
182189
183190 // search for font in list
Original file line number Diff line number Diff line change 7373// =============================================================================
7474Bool W3DFontLibrary::loadFontData ( GameFont *font )
7575{
76- FontCharsClass *fontChar;
77-
7876 // sanity
7977 if ( font == NULL )
8078 return FALSE ;
8179
82- if ((UnsignedInt)font->pointSize > 100 ) // sanity check the size - anything over 100 is probably wrong. -MW
83- fontChar = NULL ;
84- else
85- { // get the font data from the asset manager
86- fontChar = WW3DAssetManager::
87- Get_Instance ()->Get_FontChars ( font->nameString .str (), font->pointSize ,
88- font->bold ? true : false );
89- }
80+ // get the font data from the asset manager
81+ FontCharsClass *fontChar = WW3DAssetManager::Get_Instance ()->Get_FontChars (
82+ font->nameString .str (), font->pointSize , font->bold ? true : false );
9083
9184 if ( fontChar == NULL )
9285 {
You can’t perform that action at this time.
0 commit comments