From: Ingo Ruhnke Date: Thu, 22 Apr 2004 00:00:58 +0000 (+0000) Subject: patch from MatzeB for freeze at level start X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d320ed5f451b09d455a1a312a4aac5be04da10f8;p=supertux.git patch from MatzeB for freeze at level start SVN-Revision: 620 --- diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 2b689b8e5..64d3ee839 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -57,10 +57,17 @@ GameSession* GameSession::current_ = 0; GameSession::GameSession(const std::string& subset_, int levelnb_, int mode) - : world(0), st_gl_mode(mode), levelnb(levelnb_), subset(subset_) + : world(0), st_gl_mode(mode), levelnb(levelnb_), end_sequenze(false), + subset(subset_) { current_ = this; - end_sequenze = false; + + global_frame_counter = 0; + game_pause = false; + + fps_timer.init(true); + frame_timer.init(true); + restart_level(); } @@ -470,16 +477,9 @@ GameSession::run() Player* tux = world->get_tux(); current_ = this; - int fps_cnt; - - global_frame_counter = 0; - game_pause = false; - - fps_timer.init(true); - frame_timer.init(true); + int fps_cnt = 0; - last_update_time = st_get_ticks(); - fps_cnt = 0; + update_time = last_update_time = st_get_ticks(); /* Clear screen: */ clearscreen(0, 0, 0);