Browse Source

respect min_dt even in non-real-time mode

David Rose 22 years ago
parent
commit
220c028394
2 changed files with 3 additions and 6 deletions
  1. 3 0
      panda/src/express/clockObject.I
  2. 0 6
      panda/src/express/clockObject.cxx

+ 3 - 0
panda/src/express/clockObject.I

@@ -156,6 +156,9 @@ get_net_frame_rate() const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE double ClockObject::
 INLINE double ClockObject::
 get_dt() const {
 get_dt() const {
+  if (_max_dt > 0.0) {
+    return min(_max_dt, _dt);
+  }
   return _dt;
   return _dt;
 }
 }
 
 

+ 0 - 6
panda/src/express/clockObject.cxx

@@ -139,9 +139,6 @@ tick() {
   case M_normal:
   case M_normal:
     // Time runs as it will; we simply report time elapsing.
     // Time runs as it will; we simply report time elapsing.
     _dt = _actual_frame_time - old_time;
     _dt = _actual_frame_time - old_time;
-    if (_max_dt > 0.0) {
-      _dt = min(_max_dt, _dt);
-    }
     _reported_frame_time = _actual_frame_time;
     _reported_frame_time = _actual_frame_time;
     break;
     break;
 
 
@@ -176,9 +173,6 @@ tick() {
       _reported_frame_time = _actual_frame_time;
       _reported_frame_time = _actual_frame_time;
     }
     }
 
 
-    if (_max_dt > 0.0) {
-      _dt = min(_max_dt, _dt);
-    }
     break;
     break;
 
 
   }
   }