]> git.mxchange.org Git - flightgear.git/commitdiff
Fix reset during replay issue
authorThorstenB <brehmt@gmail.com>
Tue, 22 Mar 2011 20:02:57 +0000 (21:02 +0100)
committerThorstenB <brehmt@gmail.com>
Tue, 22 Mar 2011 20:02:57 +0000 (21:02 +0100)
Need to properly reset the replay manager's states on sim reset.
Also remove obsolete method.

src/Aircraft/replay.cxx
src/Main/fg_commands.cxx
src/Main/fg_init.cxx
src/Main/fg_init.hxx

index 9ecc353d8f6b54b8d38c2a6126b369226fb72048..538546c81087faa5fde5a2203c60fcfd1a56fb66 100644 (file)
@@ -96,6 +96,9 @@ void FGReplay::clear()
 
 void FGReplay::init()
 {
+    disable_replay = fgGetNode( "/sim/replay/disable", true );
+    replay_master = fgGetNode( "/sim/freeze/replay-state", true );
+    replay_time = fgGetNode( "/sim/replay/time", true);
     reinit();
 }
 
@@ -120,6 +123,9 @@ void FGReplay::reinit()
     {
         recycler.push_back(new FGReplayData);
     }
+    replay_master->setIntValue(0);
+    disable_replay->setBoolValue(0);
+    replay_time->setDoubleValue(0);
 }
 
 /** 
@@ -128,9 +134,6 @@ void FGReplay::reinit()
 
 void FGReplay::bind()
 {
-    disable_replay = fgGetNode( "/sim/replay/disable", true );
-    replay_master = fgGetNode( "/sim/freeze/replay-state", true );
-    replay_time = fgGetNode( "/sim/replay/time", true);
 }
 
 
index d2b5b021e48a0b45317882cf3e4e6ad503a5a7a4..8f7a1c18cab9ebb2ca620b7188244e0c520152fe 100644 (file)
@@ -221,7 +221,7 @@ do_exit (const SGPropertyNode * arg)
 static bool
 do_reset (const SGPropertyNode * arg)
 {
-    doSimulatorReset();
+    fgReInitSubsystems();
     return true;
 }
 
index 260f9ef2268923c3319f6956b78ef84bc039f60b..d77a81a415e8746bfa7dd237adebc449725575a5 100644 (file)
@@ -1517,7 +1517,7 @@ bool fgInitSubsystems() {
     return true;
 }
 
-
+// Reset: this is what the 'reset' command (and hence, GUI) is attached to
 void fgReInitSubsystems()
 {
     static const SGPropertyNode *master_freeze
@@ -1570,13 +1570,6 @@ void fgReInitSubsystems()
 }
 
 
-void doSimulatorReset(void)  // from gui_local.cxx -- TODO merge with fgReInitSubsystems()
-{
-    
-
-    fgReInitSubsystems();
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 // helper object to implement the --show-aircraft command.
 // resides here so we can share the fgFindAircraftInDir template above,
index 256716a8800eda171de5f0c636eb9647d45cbfb3..b23fead60bd2c108d9379d18ae98dfaa16407750 100644 (file)
@@ -62,16 +62,10 @@ bool fgInitGeneral ();
 // gear, its initialization call should located in this routine.
 bool fgInitSubsystems();
 
-
-// Reset
+// Reset: this is what the 'reset' command (and hence, GUI) is attached to
 void fgReInitSubsystems();
 
-/**
- * this is what the 'reset' command (and hence, GUI) is attached too
- * it overlaps with fgReInitSubsystems quite substantially
- */
-void doSimulatorReset(void);
-
 // Set the initial position based on presets (or defaults)
 bool fgInitPosition();