Skip to content
Permalink
Browse files

Test for font error at startup

  • Loading branch information...
ccw808 committed Jul 19, 2015
1 parent 0feee13 commit cce5c123c1362a24f0d9911fa50cc748990740ec
Showing with 9 additions and 2 deletions.
  1. +9 −2 MTA10/core/CGraphics.cpp
@@ -1084,9 +1084,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] );
}
}
}

0 comments on commit cce5c12

Please sign in to comment.
You can’t perform that action at this time.