ignore messages.pot
[supertux.git] / src / game_session.cpp
index b4d44ad..edf057f 100644 (file)
@@ -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;