Skip to content

Commit

Permalink
Test for font error at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Jul 19, 2015
1 parent e81a635 commit 3d0201f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions MTA10/core/CGraphics.cpp
Expand Up @@ -1094,9 +1094,16 @@ bool CGraphics::LoadStandardDXFonts ( void )

for ( uint i = 0 ; i < m_FontResourceNames.size () ; i++ )
{
if ( !AddFontResourceEx ( CalcMTASAPath ( "MTA\\cgui\\" + m_FontResourceNames[i] ), FR_PRIVATE, 0 ) )
SString strPathFilename = CalcMTASAPath ( "MTA\\cgui\\" + m_FontResourceNames[i] );
if ( AddFontResourceEx ( strPathFilename, FR_PRIVATE, 0 ) )
{
BrowseToSolution ( "mta-datafiles-missing", EXIT_GAME_FIRST | ASK_GO_ONLINE, "Error loading MTA font " + m_FontResourceNames[i] );
SString strFileMd5 = GenerateHashHexStringFromFile ( EHashFunctionType::MD5, strPathFilename );
uint uiFileSize = (uint)FileSize( strPathFilename );
AddReportLog( 9442, SString( "Problem with AddFontResourceEx [MD5:%s Size:%d] %s ", *strFileMd5, uiFileSize, *strPathFilename ) );
if ( !FileExists( strPathFilename ) )
{
BrowseToSolution ( "mta-datafiles-missing", EXIT_GAME_FIRST | ASK_GO_ONLINE, "Error loading MTA font " + m_FontResourceNames[i] );
}
}
}

Expand Down

0 comments on commit 3d0201f

Please sign in to comment.