X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftitle.cpp;h=df500cfab21116edc7095818a8d6b794796103f0;hb=db7e44a2f93bd7c0e7477690e7cc30b6d5273b06;hp=fad1e81004050ba4d32d0833baf4613aba817fee;hpb=45d21c1c59a58aa557b62d3aa22ba89a975e323c;p=supertux.git diff --git a/src/title.cpp b/src/title.cpp index fad1e8100..df500cfab 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -36,7 +36,6 @@ #include #endif -#include "defines.h" #include "app/globals.h" #include "title.h" #include "video/screen.h" @@ -52,7 +51,7 @@ #include "gameloop.h" #include "worldmap.h" #include "leveleditor.h" -#include "scene.h" +#include "player_status.h" #include "tile.h" #include "sector.h" #include "object/tilemap.h" @@ -86,7 +85,7 @@ void resume_demo() { // FIXME: shouldn't be needed if GameSession // didn't relay on global variables - titlesession->get_current_sector()->activate(); + titlesession->get_current_sector()->activate("main"); titlesession->set_current(); frame_rate.update(); @@ -215,7 +214,7 @@ void check_levels_contrib_menu() contrib_subset_menu->additem(MN_HL,"",0,0); contrib_subset_menu->additem(MN_BACK, _("Back"), 0, 0); - titlesession->get_current_sector()->activate(); + titlesession->get_current_sector()->activate("main"); titlesession->set_current(); } } @@ -246,16 +245,16 @@ void draw_demo(float elapsed_time) world->play_music(LEVEL_MUSIC); - tux->key_event((SDLKey) keymap.right,DOWN); + tux->key_event((SDLKey) keymap.right, true); if(random_timer.check()) { random_timer.start(float(rand() % 3000 + 3000) / 1000.); walking = !walking; } else { if(walking) - tux->key_event((SDLKey) keymap.jump,UP); + tux->key_event((SDLKey) keymap.jump, false); else - tux->key_event((SDLKey) keymap.jump,DOWN); + tux->key_event((SDLKey) keymap.jump, true); } // Wrap around at the end of the level back to the beginnig @@ -286,6 +285,7 @@ void title(void) { walking = true; LevelEditor* leveleditor; + MusicRef credits_music; Ticks::pause_init(); @@ -297,7 +297,7 @@ void title(void) logo = new Surface(datadir + "/images/title/logo.png", true); img_choose_subset = new Surface(datadir + "/images/status/choose-level-subset.png", true); - titlesession->get_current_sector()->activate(); + titlesession->get_current_sector()->activate("main"); titlesession->set_current(); /* --- Main title loop: --- */ @@ -347,10 +347,14 @@ void title(void) context.draw_text(white_small_text, " SuperTux " PACKAGE_VERSION "\n", Vector(0, screen->h - 70), LEFT_ALLIGN, LAYER_FOREGROUND1); context.draw_text(white_small_text, - _("Copyright (c) 2003 SuperTux Devel Team\n" - "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n" - "are welcome to redistribute it under certain conditions; see the file COPYING\n" - "for details.\n"), Vector(0, screen->h - 70 + white_small_text->get_height()), LEFT_ALLIGN, LAYER_FOREGROUND1); + _( +"Copyright (c) 2003 SuperTux Devel Team\n" +"This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n" +"are welcome to redistribute it under certain conditions; see the file COPYING\n" +"for details.\n" + ), + Vector(0, screen->h - 70 + white_small_text->get_height()), + LEFT_ALLIGN, LAYER_FOREGROUND1); /* Don't draw menu, if quit is true */ Menu* menu = Menu::current(); @@ -381,6 +385,8 @@ void title(void) break; case MNID_CREDITS: fadeout(500); + credits_music = SoundManager::get()->load_music(datadir + "/music/credits.ogg"); + SoundManager::get()->play_music(credits_music); display_text_file("credits.txt", SCROLL_SPEED_CREDITS, white_big_text , white_text, white_small_text, blue_text ); fadeout(500); Menu::set_current(main_menu);