#include "titlescreen.h" #include "drawutils.h" TitleScreen::TitleScreen(SDL_Surface* display) : GameState(display) { background = NULL; title_banner = NULL; } GameState::~GameState() { if (background != NULL) SDL_FreeSurface(background); if (background != NULL) SDL_FreeSurface(title_banner); } bool TitleScreen::init() { background = DrawUtils::load("background.bmp"); if (background == NULL) { #ifdef DEBUG std::cerr << "debug: TitleScreen::init(): error: Couldn't load background image\n"; #endif return false; } title_banner = DrawUtils::load("title.bmp"); if (title_banner == NULL) { #ifdef DEBUG std::cerr << "debug: TitleScreen::init(): error: Couldn't load title banner\n"; #endif return false; } } void TitleScreen::execute(stack<TitleScreen*> &game_state) throw(StateExit) { }