#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) { debug("TitleScreen::init(): error: Couldn't load background image"); return false; } title_banner = DrawUtils::load("title.bmp"); if (title_banner == NULL) { debug("TitleScreen::init(): error: Couldn't load title banner"); return false; } } void TitleScreen::execute(stack &game_state) throw(StateExit) { }