From: Arvid Norlander Date: Fri, 21 Jul 2006 20:56:10 +0000 (+0000) Subject: Reverted change in game_session.cpp and game_session.hpp from 4059 to fix bug. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=35fedf071665852c1c1e10b3d4b053a2347129e5;p=supertux.git Reverted change in game_session.cpp and game_session.hpp from 4059 to fix bug. SVN-Revision: 4062 --- diff --git a/src/game_session.cpp b/src/game_session.cpp index c2aaebd1d..c5729ebfe 100644 --- a/src/game_session.cpp +++ b/src/game_session.cpp @@ -122,8 +122,7 @@ GameSession::restart_level(bool fromBeginning) level->stats.total_badguys = level->get_total_badguys(); level->stats.total_secrets = level->get_total_count(); level->stats.reset(); - if (!fromBeginning) - level->stats.declare_invalid(); + if (!fromBeginning) level->stats.declare_invalid(); if (fromBeginning) reset_sector=""; if(reset_sector != "") { @@ -484,9 +483,14 @@ GameSession::update(float elapsed_time) // Update the world state and all objects in the world if(!game_pause) { - currentsector->update(elapsed_time * speed_factor); - play_time += elapsed_time; - currentsector->update(elapsed_time); + // Update the world + if (end_sequence == ENDSEQUENCE_RUNNING) { + currentsector->update(elapsed_time/2); + } else if(end_sequence == NO_ENDSEQUENCE) { + play_time += elapsed_time; //TODO: make sure we don't count cutscene time + level->stats.time = play_time; + currentsector->update(elapsed_time); + } } // update sounds @@ -585,7 +589,6 @@ GameSession::start_sequence(const std::string& sequencename) if(end_sequence) return; - speed_factor = 0.5; end_sequence = ENDSEQUENCE_RUNNING; endsequence_timer.start(7.3); last_x_pos = -1; diff --git a/src/game_session.hpp b/src/game_session.hpp index 92a0b6987..abc507e95 100644 --- a/src/game_session.hpp +++ b/src/game_session.hpp @@ -82,12 +82,6 @@ public: void toggle_pause(); - /** - * Allows adjusting the game speed with a factor. 1.0 means normal speed - * 0.0 means the game is stopped. - */ - void adjust_game_speed(float factor); - private: void check_end_conditions(); void process_events(); @@ -133,9 +127,6 @@ private: std::string reset_sector; Vector reset_pos; - /// speed factos - float speed_factor; - // the sector and spawnpoint we should spawn after this frame std::string newsector; std::string newspawnpoint;