Diffstat (limited to 'noncore/games/sfcave-sdl/font.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/font.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/noncore/games/sfcave-sdl/font.cpp b/noncore/games/sfcave-sdl/font.cpp index 2976d48..1988252 100644 --- a/noncore/games/sfcave-sdl/font.cpp +++ b/noncore/games/sfcave-sdl/font.cpp @@ -10,3 +10,3 @@ BFont *FontHandler :: helpFont; -void FontHandler :: init() +bool FontHandler :: init() { @@ -19,2 +19,11 @@ void FontHandler :: init() colouredFont = 0; + + // Check if we are installed correctly (we need fonts to function) + if ( menuSelFont == 0 || menuUnSelFont == 0 || whiteFont == 0 || helpFont == 0 ) + { + printf( "One or more fonts are not installed correctly\n" ); + return false; + } + + return true; } @@ -23,7 +32,10 @@ void FontHandler :: cleanUp() { + if ( menuSelFont ) delete menuSelFont; + if ( menuUnSelFont ) delete menuUnSelFont; + if ( whiteFont ) delete whiteFont; + if ( helpFont ) delete helpFont; - if ( colouredFont ) |