From: Ingo Ruhnke Date: Sun, 11 Apr 2004 15:33:53 +0000 (+0000) Subject: - moved time_left timer into gamesession X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ef759f3d6b7ea75d2784a81d0ed36d0ecc1009f7;p=supertux.git - moved time_left timer into gamesession SVN-Revision: 478 --- diff --git a/src/gameloop.h b/src/gameloop.h index 203306e2b..7aeeec59b 100644 --- a/src/gameloop.h +++ b/src/gameloop.h @@ -53,6 +53,8 @@ class GameSession int levelnb; public: + timer_type time_left; + GameSession(); GameSession(const std::string& filename); GameSession(const std::string& subset, int levelnb, int mode); diff --git a/src/player.cpp b/src/player.cpp index 607e8ae83..af3df7bea 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -253,8 +253,6 @@ Player::action(double frame_ratio) /* ---- DONE HANDLING TUX! --- */ /* Handle invincibility timer: */ - - if (get_current_music() == HERRING_MUSIC && !timer_check(&invincible_timer)) { /* @@ -263,8 +261,8 @@ Player::action(double frame_ratio) but are we in hurry ? */ - - if (timer_get_left(&time_left) < TIME_WARNING) + // FIXME: Move this to gamesession + if (timer_get_left(&GameSession::current()->time_left) < TIME_WARNING) { /* yes, we are in hurry stop the herring_song, prepare to play the correct diff --git a/src/scene.cpp b/src/scene.cpp index a4cb09547..2ed15f417 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -20,7 +20,5 @@ float scroll_x; unsigned int global_frame_counter; -timer_type time_left; - // EOF // diff --git a/src/scene.h b/src/scene.h index c9547c376..a517b8e2d 100644 --- a/src/scene.h +++ b/src/scene.h @@ -32,6 +32,4 @@ extern PlayerStatus player_status; extern float scroll_x; extern unsigned int global_frame_counter; -extern timer_type time_left; - #endif /*SUPERTUX_SCENE_H*/