]> git.mxchange.org Git - flightgear.git/commitdiff
Minor replay issues
authorThorstenB <brehmt@gmail.com>
Thu, 24 Mar 2011 22:30:09 +0000 (23:30 +0100)
committerThorstenB <brehmt@gmail.com>
Thu, 24 Mar 2011 22:30:09 +0000 (23:30 +0100)
When disabling replay: don't clear buffers and restore most recent frame

src/Aircraft/replay.cxx

index 538546c81087faa5fde5a2203c60fcfd1a56fb66..bd3bab7bf3ce52a45e6a3a7a35760137de81c60f 100644 (file)
@@ -24,6 +24,7 @@
 #  include "config.h"
 #endif
 
+#include <float.h>
 #include <simgear/constants.h>
 #include <simgear/structure/exception.hxx>
 
@@ -156,11 +157,16 @@ void FGReplay::update( double dt )
     timingInfo.clear();
     stamp("begin");
 
-    if (( sim_time != 0.0 )&&
-        ( disable_replay->getBoolValue() ))
+    if ( disable_replay->getBoolValue() )
     {
-        // we were recording data
-        reinit();
+        if (replay_master->getIntValue())
+        {
+            // replay was active, restore most recent frame
+            replay(DBL_MAX);
+        }
+        replay_master->setIntValue(0);
+        replay_time->setDoubleValue(0);
+        disable_replay->setBoolValue(0);
     }
 
     int replay_state = replay_master->getIntValue();