From 5ace4e9632c7ee58e5df04afc927148c807c615d Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Tue, 22 Mar 2011 21:02:57 +0100 Subject: [PATCH] Fix reset during replay issue Need to properly reset the replay manager's states on sim reset. Also remove obsolete method. --- src/Aircraft/replay.cxx | 9 ++++++--- src/Main/fg_commands.cxx | 2 +- src/Main/fg_init.cxx | 9 +-------- src/Main/fg_init.hxx | 10 ++-------- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/Aircraft/replay.cxx b/src/Aircraft/replay.cxx index 9ecc353d8..538546c81 100644 --- a/src/Aircraft/replay.cxx +++ b/src/Aircraft/replay.cxx @@ -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); } diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index d2b5b021e..8f7a1c18c 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -221,7 +221,7 @@ do_exit (const SGPropertyNode * arg) static bool do_reset (const SGPropertyNode * arg) { - doSimulatorReset(); + fgReInitSubsystems(); return true; } diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 260f9ef22..d77a81a41 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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, diff --git a/src/Main/fg_init.hxx b/src/Main/fg_init.hxx index 256716a88..b23fead60 100644 --- a/src/Main/fg_init.hxx +++ b/src/Main/fg_init.hxx @@ -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();