pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r3602 - in trunk/pingus: . src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3602 - in trunk/pingus: . src
Date: Tue, 1 Jul 2008 01:09:35 +0200

Author: grumbel
Date: 2008-07-01 01:09:26 +0200 (Tue, 01 Jul 2008)
New Revision: 3602

Modified:
   trunk/pingus/SConstruct
   trunk/pingus/src/game_session.cpp
   trunk/pingus/src/game_session.hpp
Log:
Removed some old junk

Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct     2008-06-30 23:03:54 UTC (rev 3601)
+++ trunk/pingus/SConstruct     2008-06-30 23:09:26 UTC (rev 3602)
@@ -120,7 +120,6 @@
 'src/sprite.cpp',
 'src/fps_counter.cpp', 
 'src/game_session.cpp', 
-'src/game_session_result.cpp', 
 'src/game_time.cpp', 
 'src/gettext.cpp', 
 'src/global_event.cpp', 

Modified: trunk/pingus/src/game_session.cpp
===================================================================
--- trunk/pingus/src/game_session.cpp   2008-06-30 23:03:54 UTC (rev 3601)
+++ trunk/pingus/src/game_session.cpp   2008-06-30 23:09:26 UTC (rev 3602)
@@ -22,7 +22,6 @@
 #include "client.hpp"
 #include "server.hpp"
 #include "game_session.hpp"
-#include "game_session_result.hpp"
 #include "resource.hpp"
 #include "pingu_holder.hpp"
 #include "world.hpp"
@@ -61,12 +60,6 @@
   client->on_shutdown();
 }
 
-GameSessionResult
-GameSession::get_result()
-{
-  return GameSessionResult();
-}
-
 bool
 GameSession::draw(DrawingContext& gc)
 {
@@ -107,48 +100,50 @@
         ScreenManager::instance()->replace_screen(new ResultScreen(result), 
true);
       else
         ScreenManager::instance()->pop_screen();
-      return;
+
     }
+  else
+    {
+      // how much time we have to account for while doing world updates
+      int time_passed = int(delta.get_time() * 1000) + world_delay;
+      // how much time each world update represents
+      int update_time = game_speed;
 
-  // how much time we have to account for while doing world updates
-  int time_passed = int(delta.get_time() * 1000) + world_delay;
-  // how much time each world update represents
-  int update_time = game_speed;
-
-  //left_over_time = 0;
-  if (0){
-    int i;
-    for (i = 0;
-         ((i * update_time < time_passed)
-          || i < min_frame_skip)
-           && !(i > max_frame_skip);
-         ++i)
-      {
-        // This updates the world and all objects
-        server->update ();
+      //left_over_time = 0;
+      if (0){
+        int i;
+        for (i = 0;
+             ((i * update_time < time_passed)
+              || i < min_frame_skip)
+               && !(i > max_frame_skip);
+             ++i)
+          {
+            // This updates the world and all objects
+            server->update ();
+          }
       }
-  }
 
-  // update the world (and the objects in it) in constant steps to account
-  // for the time the previous frame took
+      // update the world (and the objects in it) in constant steps to account
+      // for the time the previous frame took
 
-  // invariant: world_updates - the number of times the world
-  // has been updated during this frame
-  int world_updates = 0;
+      // invariant: world_updates - the number of times the world
+      // has been updated during this frame
+      int world_updates = 0;
 
-  while ((world_updates+1)*update_time <= time_passed) {
-    server->update ();
-    world_updates++;
-  }
-  // save how far behind is the world compared to the actual time
-  // so that we can account for that while updating in the next frame
-  world_delay = time_passed - (world_updates*update_time);
+      while ((world_updates+1)*update_time <= time_passed) {
+        server->update ();
+        world_updates++;
+      }
+      // save how far behind is the world compared to the actual time
+      // so that we can account for that while updating in the next frame
+      world_delay = time_passed - (world_updates*update_time);
 
-  // Time that got not used for updates
-  //left_over_time = time_passed - (i * update_time);
+      // Time that got not used for updates
+      //left_over_time = time_passed - (i * update_time);
 
-  // Client is independend of the update limit, well, not completly...
-  client->update(delta);
+      // Client is independend of the update limit, well, not completly...
+      client->update(delta);
+    }
 }
 
 void

Modified: trunk/pingus/src/game_session.hpp
===================================================================
--- trunk/pingus/src/game_session.hpp   2008-06-30 23:03:54 UTC (rev 3601)
+++ trunk/pingus/src/game_session.hpp   2008-06-30 23:09:26 UTC (rev 3602)
@@ -27,8 +27,6 @@
 
 class Client;
 class Server;
-class GameSessionResult;
-class DemoPlayer;
 
 /** You can use this class to start up a game session, which consist
     of a single level. */
@@ -58,9 +56,6 @@
   /** Clean up */
   ~GameSession ();
 
-  /** Get the results of the last gaming session */
-  GameSessionResult get_result ();
-
   // Overloaded Screen functions
   /** Draw this screen */
   bool draw(DrawingContext& gc);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]