Permalink
Browse files

Added fix as discussed in http://pushbuttonengine.com/forum/viewtopic…

….php?f=5&t=1068

git-svn-id: https://pushbuttonengine.googlecode.com/svn/trunk@1095 6b8e678a-0755-11de-b5bf-434079a3519f
  • Loading branch information...
1 parent 4510b79 commit ad7bfb332b27dc456dae2eea06a7d1c63dc16ce7 Giggsy@gmx.at committed Sep 3, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/com/pblabs/engine/core/ProcessManager.as
@@ -8,13 +8,14 @@
******************************************************************************/
package com.pblabs.engine.core
{
- import com.pblabs.engine.PBE;
import com.pblabs.engine.debug.*;
+ import com.pblabs.engine.PBE;
+ import com.pblabs.engine.PBUtil;
import com.pblabs.engine.serialization.TypeUtility;
-
import flash.events.Event;
import flash.utils.getTimer;
+
/**
* The process manager manages all time related functionality in the engine.
* It provides mechanisms for performing actions every frame, every tick, or
@@ -472,6 +473,11 @@ package com.pblabs.engine.core
elapsed = 0;
}
+ // Make sure that we don't fall behind too far. This helps correct
+ // for short-term drops in framerate as well as the scenario where
+ // we are consistently running behind.
+ elapsed = PBUtil.clamp(elapsed, 0, 300);
+
// Make sure we don't lose time to accumulation error.
// Not sure this gains us anything, so disabling -- BJG
//_virtualTime = startTime + deltaTime;

0 comments on commit ad7bfb3

Please sign in to comment.