Skip to content

Commit

Permalink
Prevent a crash if fonts could not be loaded
Browse files Browse the repository at this point in the history
Show a critical error dialog instead.

See: crash report #446
  • Loading branch information
dscharrer committed Jan 26, 2013
1 parent 35ffaee commit 3eec2ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/Text.cpp
Expand Up @@ -386,6 +386,13 @@ bool ARX_Text_Init() {
hFontInGameNote = nFontInGameNote;
hFontInBook = nFontInBook;

if(!hFontMainMenu || !hFontMenu || !hFontControls || !hFontCredits || !hFontInGame
|| !hFontInGameNote || !hFontInBook) {
LogCritical << "Could not load font " << file << " for scale " << scale
<< " / small scale " << small_scale;
return false;
}

LogInfo << "Loaded font " << file << " with sizes " << hFontMainMenu->getSize() << ", "
<< hFontMenu->getSize() << ", " << hFontControls->getSize()
<< ", " << hFontCredits->getSize() << ", " << hFontInGame->getSize() << ", "
Expand Down

0 comments on commit 3eec2ef

Please sign in to comment.