Added some error checking when loading the GUI font
This commit is contained in:
parent
c993ba7055
commit
606aaea675
1 changed files with 29 additions and 5 deletions
|
@ -84,9 +84,7 @@ enum
|
||||||
PANEL_DISPLAY,
|
PANEL_DISPLAY,
|
||||||
PANEL_SOUND,
|
PANEL_SOUND,
|
||||||
PANEL_INPUT,
|
PANEL_INPUT,
|
||||||
#ifndef PANDORA
|
|
||||||
PANEL_CUSTOM,
|
PANEL_CUSTOM,
|
||||||
#endif
|
|
||||||
PANEL_MISC,
|
PANEL_MISC,
|
||||||
PANEL_SAVESTATES,
|
PANEL_SAVESTATES,
|
||||||
#ifdef ANDROIDSDL
|
#ifdef ANDROIDSDL
|
||||||
|
@ -766,9 +764,35 @@ namespace widgets
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
TTF_Init();
|
TTF_Init();
|
||||||
#ifdef USE_SDL1
|
#ifdef USE_SDL1
|
||||||
|
try
|
||||||
|
{
|
||||||
gui_font = new gcn::contrib::SDLTrueTypeFont("data/AmigaTopaz.ttf", 15);
|
gui_font = new gcn::contrib::SDLTrueTypeFont("data/AmigaTopaz.ttf", 15);
|
||||||
|
}
|
||||||
|
catch (const std::exception& ex)
|
||||||
|
{
|
||||||
|
write_log("Could not open data/AmigaTopaz.ttf!\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
write_log("An error occurred while trying to open data/AmigaTopaz.ttf!\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
#elif USE_SDL2
|
#elif USE_SDL2
|
||||||
|
try
|
||||||
|
{
|
||||||
gui_font = new gcn::SDLTrueTypeFont("data/AmigaTopaz.ttf", 15);
|
gui_font = new gcn::SDLTrueTypeFont("data/AmigaTopaz.ttf", 15);
|
||||||
|
}
|
||||||
|
catch(const std::exception& ex)
|
||||||
|
{
|
||||||
|
write_log("Could not open data/AmigaTopaz.ttf!\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
write_log("An error occurred while trying to open data/AmigaTopaz.ttf!\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
gcn::Widget::setGlobalFont(gui_font);
|
gcn::Widget::setGlobalFont(gui_font);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue