1
0
Fork 0

Fix reset during replay issue

Need to properly reset the replay manager's states on sim reset.
Also remove obsolete method.
This commit is contained in:
ThorstenB 2011-03-22 21:02:57 +01:00
parent 0114fd962e
commit 5ace4e9632
4 changed files with 10 additions and 20 deletions

View file

@ -96,6 +96,9 @@ void FGReplay::clear()
void FGReplay::init() 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(); reinit();
} }
@ -120,6 +123,9 @@ void FGReplay::reinit()
{ {
recycler.push_back(new FGReplayData); 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() 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);
} }

View file

@ -221,7 +221,7 @@ do_exit (const SGPropertyNode * arg)
static bool static bool
do_reset (const SGPropertyNode * arg) do_reset (const SGPropertyNode * arg)
{ {
doSimulatorReset(); fgReInitSubsystems();
return true; return true;
} }

View file

@ -1517,7 +1517,7 @@ bool fgInitSubsystems() {
return true; return true;
} }
// Reset: this is what the 'reset' command (and hence, GUI) is attached to
void fgReInitSubsystems() void fgReInitSubsystems()
{ {
static const SGPropertyNode *master_freeze 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. // helper object to implement the --show-aircraft command.
// resides here so we can share the fgFindAircraftInDir template above, // resides here so we can share the fgFindAircraftInDir template above,

View file

@ -63,15 +63,9 @@ bool fgInitGeneral ();
bool fgInitSubsystems(); bool fgInitSubsystems();
// Reset // Reset: this is what the 'reset' command (and hence, GUI) is attached to
void fgReInitSubsystems(); 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) // Set the initial position based on presets (or defaults)
bool fgInitPosition(); bool fgInitPosition();