[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.18,1.19
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.18,1.19 |
Date: |
8 Oct 2002 17:53:49 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv18856
Modified Files:
game_session.cxx
Log Message:
timing fixes
Index: game_session.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/game_session.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- game_session.cxx 7 Oct 2002 23:11:09 -0000 1.18
+++ game_session.cxx 8 Oct 2002 17:53:47 -0000 1.19
@@ -92,14 +92,16 @@
int time_passed = (CL_System::get_time() - last_update) + left_over_time;
int update_time = game_speed;
- int min_frame_skip = 0;
- int max_frame_skip = 0;
+ int min_frame_skip = 1;
+ int max_frame_skip = 1;
left_over_time = 0;
int i;
for (i = 0;
- (i * update_time < time_passed && i < min_frame_skip + 1);
+ ((i * update_time < time_passed)
+ || i < min_frame_skip)
+ && !(i > max_frame_skip);
++i)
{
// This updates the world and all objects
@@ -107,11 +109,13 @@
++number_of_updates;
}
+ //std::cout << "Number of updates: " << i << std::endl;
+
// Time that got not used for updates
left_over_time = time_passed - (i * update_time);
last_update = CL_System::get_time();
-
+
if (!max_cpu_usage && left_over_time < 0)
{
CL_System::sleep(-left_over_time);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.18,1.19,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.19,1.20 basher.hxx,1.12,1.13
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.19,1.20 globals.cxx,1.2,1.3 globals.hxx,1.8,1.9 pingus_main.cxx,1.22,1.23
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.19,1.20 basher.hxx,1.12,1.13
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.19,1.20 globals.cxx,1.2,1.3 globals.hxx,1.8,1.9 pingus_main.cxx,1.22,1.23
- Index(es):