X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_session.cpp;h=edf057fefddd0cf5d3c23e8e61e774b272a980b2;hb=58da7bdf7b352989ef19d89a498938a12ca91b03;hp=b4d44ade8ad5b0fdb342b36d4dd2852dba248ec7;hpb=60908c905544776c376421b8d3e12eeb936c068f;p=supertux.git diff --git a/src/game_session.cpp b/src/game_session.cpp index b4d44ade8..edf057fef 100644 --- a/src/game_session.cpp +++ b/src/game_session.cpp @@ -533,14 +533,19 @@ GameSession::run() if(!game_pause) global_time += elapsed_time; - skipdraw = false; - // regulate fps ticks = SDL_GetTicks(); if(ticks > fps_nextframe_ticks) { - // don't draw all frames when we're getting too slow - skipdraw = true; + if(skipdraw == true) { + // already skipped last frame? we have to slow down the game then... + skipdraw = false; + fps_nextframe_ticks -= (Uint32) (1000.0 / LOGICAL_FPS); + } else { + // don't draw all frames when we're getting too slow + skipdraw = true; + } } else { + skipdraw = false; while(fps_nextframe_ticks > ticks) { /* just wait */ // If we really have to wait long, then do an imprecise SDL_Delay() @@ -631,6 +636,12 @@ GameSession::run() } void +GameSession::finish() +{ + exit_status = ES_LEVEL_FINISHED; +} + +void GameSession::respawn(const std::string& sector, const std::string& spawnpoint) { newsector = sector;