X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Ftitle_screen.cpp;h=fbe7fee0b07324bb367055855dce7fe7a5fb4cf0;hb=08bddcf4d4fbe2edf9a0078dc6f3c3275ef05302;hp=d77e38169b60ef51ac15ad73b61c4d98007fb290;hpb=328febc1da8a33e97b33234b37037a55c4db5cb8;p=supertux.git diff --git a/src/supertux/title_screen.cpp b/src/supertux/title_screen.cpp index d77e38169..fbe7fee0b 100644 --- a/src/supertux/title_screen.cpp +++ b/src/supertux/title_screen.cpp @@ -39,22 +39,23 @@ #include "util/reader.hpp" #include "video/drawing_context.hpp" +#include #include -TitleScreen::TitleScreen() : +TitleScreen::TitleScreen(PlayerStatus* player_status) : main_menu(new MainMenu()), frame(), controller(), titlesession() { controller.reset(new CodeController()); - titlesession.reset(new GameSession("levels/misc/menu.stl")); + titlesession.reset(new GameSession("levels/misc/menu.stl", player_status)); Player* player = titlesession->get_current_sector()->player; player->set_controller(controller.get()); player->set_speedlimit(230); //MAX_WALK_XM - frame = std::auto_ptr(new Surface("images/engine/menu/frame.png")); + frame = Surface::create("images/engine/menu/frame.png"); } std::string @@ -89,7 +90,7 @@ TitleScreen::make_tux_jump() controller->press(Controller::RIGHT); // Check if we should press the jump button - Rect lookahead = tux->get_bbox(); + Rectf lookahead = tux->get_bbox(); lookahead.p2.x += 96; bool pathBlocked = !sector->is_free_of_statics(lookahead); if ((pathBlocked && jumpWasReleased) || !tux->on_ground()) { @@ -113,8 +114,6 @@ TitleScreen::~TitleScreen() void TitleScreen::setup() { - player_status->reset(); - Sector* sector = titlesession->get_current_sector(); if(Sector::current() != sector) { sector->play_music(LEVEL_MUSIC); @@ -139,17 +138,15 @@ TitleScreen::draw(DrawingContext& context) sector->draw(context); // FIXME: Add something to scale the frame to the resolution of the screen - context.draw_surface(frame.get(), Vector(0,0),LAYER_FOREGROUND1); + //context.draw_surface(frame, Vector(0,0),LAYER_FOREGROUND1); - context.draw_text(Resources::small_font, "SuperTux " PACKAGE_VERSION "\n", - Vector(5, SCREEN_HEIGHT - 50), ALIGN_LEFT, LAYER_FOREGROUND1); context.draw_text(Resources::small_font, - _( - "Copyright (c) 2007 SuperTux Devel Team\n" - "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to\n" + "SuperTux " PACKAGE_VERSION "\n" + + _("Copyright") + " (c) 2003-2013 SuperTux Devel Team\n" + + _("This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to\n" "redistribute it under certain conditions; see the file COPYING for details.\n" ), - Vector(5, SCREEN_HEIGHT - 50 + Resources::small_font->get_height() + 5), + Vector(5, SCREEN_HEIGHT - 50), ALIGN_LEFT, LAYER_FOREGROUND1); }