瀏覽代碼

respect min_dt even in non-real-time mode

David Rose 22 年之前
父節點
當前提交
220c028394
共有 2 個文件被更改,包括 3 次插入6 次删除
  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::
 get_dt() const {
+  if (_max_dt > 0.0) {
+    return min(_max_dt, _dt);
+  }
   return _dt;
 }
 

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

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