X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftitle.cpp;h=5b31fe3b1aa82e4a7b86cebf836d0bf44ee1125e;hb=f53572ad2b744ddddd7cc4b6479489543d44f98d;hp=da22b4936f684be408cedc76857b012e5ed4e3c9;hpb=fc73efa7ff699fe3c9c237845b6f4fda0d999862;p=supertux.git diff --git a/src/title.cpp b/src/title.cpp index da22b4936..5b31fe3b1 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -35,7 +35,6 @@ #include "title.hpp" #include "mainloop.hpp" -#include "video/screen.hpp" #include "video/drawing_context.hpp" #include "video/surface.hpp" #include "audio/sound_manager.hpp" @@ -56,6 +55,7 @@ #include "resources.hpp" #include "gettext.hpp" #include "textscroller.hpp" +#include "fadeout.hpp" #include "file_system.hpp" #include "control/joystickkeyboardcontroller.hpp" #include "control/codecontroller.hpp" @@ -63,6 +63,7 @@ #include "log.hpp" #include "options_menu.hpp" #include "console.hpp" +#include "random_generator.hpp" enum MainMenuIDs { MNID_STARTGAME, @@ -239,9 +240,9 @@ TitleScreen::make_tux_jump() if(pathBlocked) jumpDuration = 0.5; else - jumpDuration = float(rand() % 500 + 300) / 1000.0; + jumpDuration = systemRandom.randf(0.3, 0.8); jumpPushTimer.start(jumpDuration); - randomWaitTimer.start(float(rand() % 3000 + 3000) / 1000.0); + randomWaitTimer.start(systemRandom.randf(3.0, 6.0)); } // Keep jump button pressed @@ -299,6 +300,7 @@ TitleScreen::leave() { Sector* sector = titlesession->get_current_sector(); sector->deactivate(); + Menu::set_current(NULL); } void @@ -350,11 +352,11 @@ TitleScreen::update(float elapsed_time) Menu::push_current(contrib_menu.get()); break; case MNID_CREDITS: - fadeout(500); - main_loop->push_screen(new TextScroller("credits.txt")); + main_loop->push_screen(new TextScroller("credits.txt"), + new FadeOut(0.5)); break; case MNID_QUITMAINMENU: - main_loop->quit(); + main_loop->quit(new FadeOut(0.25)); break; } } else if(menu == load_game_menu.get()) { @@ -440,8 +442,6 @@ TitleScreen::process_load_game_menu() stream << "save/" << worlddirname << "_" << slot << ".stsg"; std::string slotfile = stream.str(); - fadeout(256); - try { current_world->set_savegame_filename(slotfile); current_world->run();