Fixed frame_ratio() workaround.
[supertux.git] / src / gameloop.cpp
index 252c69b..fb3e557 100644 (file)
@@ -546,7 +546,6 @@ GameSession::run()
 
   draw();
 
-  float overlap = 0.0f;
   while (exit_status == NONE)
     {
       /* Calculate the movement-factor */
@@ -569,19 +568,12 @@ GameSession::run()
       // determistic and not different on different machines
       if(!game_pause && !Menu::current())
         {
-          frame_ratio *= game_speed;
-          frame_ratio += overlap;
-          while (frame_ratio > 0)
-            {
-              // Update the world
-              check_end_conditions();
-              if (end_sequence == ENDSEQUENCE_RUNNING)
-                action(.5f);
-              else if(end_sequence == NO_ENDSEQUENCE)
-                action(1.0f);
-              frame_ratio -= 1.0f;
-            }
-          overlap = frame_ratio;
+          // Update the world
+          check_end_conditions();
+          if (end_sequence == ENDSEQUENCE_RUNNING)
+             action(frame_ratio/2);
+          else if(end_sequence == NO_ENDSEQUENCE)
+             action(frame_ratio);
         }
       else
         {
@@ -672,14 +664,12 @@ GameSession::drawstatus()
       white_text->draw("Press ESC To Return",0,20,1);
     }
 
-  if(!end_sequence) {
-    if(!time_left.check()) {
-      white_text->draw("TIME'S UP", 224, 0, 1);
-    } else if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5) {
-      sprintf(str, "%d", time_left.get_left() / 1000 );
-      white_text->draw("TIME", 224, 0, 1);
-      gold_text->draw(str, 304, 0, 1);
-    }
+  if(!time_left.check()) {
+    white_text->draw("TIME'S UP", 224, 0, 1);
+  } else if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5) {
+    sprintf(str, "%d", time_left.get_left() / 1000 );
+    white_text->draw("TIME", 224, 0, 1);
+    gold_text->draw(str, 304, 0, 1);
   }
 
   sprintf(str, "%d", player_status.distros);