X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameloop.cpp;h=004e3db2b65be452a38aca126573b45fda716b01;hb=e5f4c975097d8a04bb375b0ef57eeb1618907e9c;hp=850000196b42288fbf2ebc2ce9cab082788e7a8e;hpb=d46c78c842ab4090a3f46e560c891234167f124b;p=supertux.git diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 850000196..004e3db2b 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -46,7 +46,6 @@ #include "app/setup.h" #include "high_scores.h" #include "gui/menu.h" -#include "badguy.h" #include "sector.h" #include "player.h" #include "level.h" @@ -89,7 +88,6 @@ GameSession::GameSession(const std::string& levelname_, int mode, { current_ = this; - global_frame_counter = 0; game_pause = false; fps_fps = 0; @@ -719,7 +717,6 @@ GameSession::run() Uint32 lastticks = SDL_GetTicks(); fps_ticks = SDL_GetTicks(); - frame_timer.start(.025, true); while (exit_status == ES_NONE) { Uint32 ticks = SDL_GetTicks(); float elapsed_time = float(ticks - lastticks) / 1000.; @@ -729,10 +726,6 @@ GameSession::run() if(elapsed_time > .05) elapsed_time = .05; - if(frame_timer.check()) { - ++global_frame_counter; - } - /* Handle events: */ currentsector->player->input.old_fire = currentsector->player->input.fire; currentsector->player->input.old_up = currentsector->player->input.old_up; @@ -858,7 +851,7 @@ GameSession::drawstatus(DrawingContext& context) context.draw_text(white_text, _("TIME's UP"), Vector(screen->w/2, 0), CENTER_ALLIGN, LAYER_FOREGROUND1); } else if (time_left.get_timeleft() > TIME_WARNING - || (global_frame_counter % 10) < 5) { + || int(global_time * 2.5) % 2) { sprintf(str, " %d", int(time_left.get_timeleft())); context.draw_text(white_text, _("TIME"), Vector(screen->w/2, 0), CENTER_ALLIGN, LAYER_FOREGROUND1);