#include <sstream>
#include <version.h>
-TitleScreen::TitleScreen(WorldState& world_state) :
+TitleScreen::TitleScreen(Savegame& savegame) :
frame(),
controller(),
titlesession(),
copyright_text()
{
controller.reset(new CodeController());
- titlesession.reset(new GameSession("levels/misc/menu.stl", world_state));
+ titlesession.reset(new GameSession("levels/misc/menu.stl", savegame));
Player* player = titlesession->get_current_sector()->player;
player->set_controller(controller.get());
Sector* sector = titlesession->get_current_sector();
sector->draw(context);
- // FIXME: Add something to scale the frame to the resolution of the screen
- //context.draw_surface(frame, Vector(0,0),LAYER_FOREGROUND1);
+ context.draw_surface_part(frame,
+ Rectf(0, 0, frame->get_width(), frame->get_height()),
+ Rectf(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
+ LAYER_FOREGROUND1);
context.draw_text(Resources::small_font,
copyright_text,
void
TitleScreen::update(float elapsed_time)
{
- g_screen_manager->set_speed(0.6f);
+ ScreenManager::current()->set_speed(0.6f);
Sector* sector = titlesession->get_current_sector();
sector->update(elapsed_time);
make_tux_jump();
- MenuManager::instance().check_menu();
-
// reopen menu if user closed it (so that the app doesn't close when user
// accidently hit ESC)
- if(!MenuManager::instance().is_active() && !g_screen_manager->has_pending_fadeout())
+ if(!MenuManager::instance().is_active() && !ScreenManager::current()->has_pending_fadeout())
{
MenuManager::instance().set_menu(MenuStorage::MAIN_MENU);
}