treewars/titlescreen.cpp

46 lines
789 B
C++
Raw Normal View History

#include "titlescreen.h"
2011-06-29 01:44:28 +00:00
#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()
{
2011-06-29 01:44:28 +00:00
background = DrawUtils::load("background.bmp");
if (background == NULL)
{
2011-06-29 02:14:55 +00:00
debug("TitleScreen::init(): error: Couldn't load background image");
2011-06-29 01:44:28 +00:00
return false;
}
title_banner = DrawUtils::load("title.bmp");
if (title_banner == NULL)
{
2011-06-29 02:14:55 +00:00
debug("TitleScreen::init(): error: Couldn't load title banner");
2011-06-29 01:44:28 +00:00
return false;
}
}
void TitleScreen::execute(stack<TitleScreen*> &game_state) throw(StateExit)
{
}