diff --git a/src/modes/world_status.cpp b/src/modes/world_status.cpp index d0036e95e..e279fddb8 100644 --- a/src/modes/world_status.cpp +++ b/src/modes/world_status.cpp @@ -31,8 +31,7 @@ WorldStatus::WorldStatus() m_time = 0.0f; m_auxiliary_timer = 0.0f; m_phase = SETUP_PHASE; - m_previous_phase = SETUP_PHASE; // initialise it just in case - m_phase = SETUP_PHASE; + m_previous_phase = UNDEFINED_PHASE; // initialise it just in case // FIXME - is it a really good idea to reload and delete the sound every race?? m_prestart_sound = sfx_manager->createSoundSource("prestart"); @@ -47,7 +46,7 @@ void WorldStatus::reset() m_time = 0.0f; m_auxiliary_timer = 0.0f; m_phase = READY_PHASE; // FIXME - unsure - m_previous_phase = SETUP_PHASE; + m_previous_phase = UNDEFINED_PHASE; } // reset //----------------------------------------------------------------------------- @@ -218,7 +217,7 @@ void WorldStatus::setTime(const float time) */ void WorldStatus::pause(Phase phase) { - assert(m_previous_phase==SETUP_PHASE); + assert(m_previous_phase==UNDEFINED_PHASE); m_previous_phase = m_phase; m_phase = phase; } // pause @@ -231,5 +230,5 @@ void WorldStatus::unpause() m_phase = m_previous_phase; // Set m_previous_phase so that we can use an assert // in pause to detect incorrect pause/unpause sequences. - m_previous_phase = SETUP_PHASE; -} + m_previous_phase = UNDEFINED_PHASE; +} // unpause diff --git a/src/modes/world_status.hpp b/src/modes/world_status.hpp index fd0e2f370..eab2bc482 100644 --- a/src/modes/world_status.hpp +++ b/src/modes/world_status.hpp @@ -71,6 +71,8 @@ public: // Display the in-game menu, but no update of world or anything IN_GAME_MENU_PHASE, + // Undefined, used in asserts to catch incorrect states. + UNDEFINED_PHASE }; protected: SFXBase *m_prestart_sound; @@ -123,11 +125,7 @@ public: /** Returns the current race time. */ float getTime() const { return m_time; } - /** Returns the value of the auxiliary timer. */ - float getAuxiliaryTimer() const {return m_auxiliary_timer; } - /** - * Call each frame, with the elapsed time as argument. - */ + /** Call each frame, with the elapsed time as argument. */ void update(const float dt); void setTime(const float time); @@ -137,15 +135,11 @@ public: virtual void enterRaceOverState(); virtual void terminateRace(); - /* - * Will be called to notify your derived class that the clock, - * which is in COUNTDOWN mode, has reached zero. - */ + /** Will be called to notify your derived class that the clock, + * which is in COUNTDOWN mode, has reached zero. */ virtual void countdownReachedZero() {}; - /* - * Called when the race actually starts. - */ + /** Called when the race actually starts. */ virtual void onGo() {};