]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/event_mgr.cxx
Mathias Fröhlich:
[simgear.git] / simgear / structure / event_mgr.cxx
index 1ada33c83abcc80190620c9416079df66f704b01..a62e83f91df7e26b94a7b42a2259eb02ef100b36 100644 (file)
@@ -4,6 +4,10 @@ void SGEventMgr::add(SGCallback* cb,
                      double interval, double delay,
                      bool repeat, bool simtime)
 {
+    // Clamp the delay value to 1 usec, so that user code can use
+    // "zero" as a synonym for "next frame".
+    if(delay <= 0) delay = 0.000001;
+
     SGTimer* t = new SGTimer;
     t->interval = interval;
     t->callback = cb;
@@ -31,9 +35,10 @@ void SGTimer::run()
 
 void SGEventMgr::update(double delta_time_sec)
 {
-    _rtQueue.update(delta_time_sec);
-    if(!_freezeProp || _freezeProp->getBoolValue() == false)
-        _simQueue.update(delta_time_sec);
+    _simQueue.update(delta_time_sec);
+    
+    double rt = _rtProp ? _rtProp->getDoubleValue() : 0;
+    _rtQueue.update(rt);
 }
 
 ////////////////////////////////////////////////////////////////////////