Old reset code-path is removed.
This commit is contained in:
parent
5e6c2b8e82
commit
03aa642155
3 changed files with 2 additions and 88 deletions
|
@ -205,7 +205,7 @@ do_exit (const SGPropertyNode * arg)
|
||||||
static bool
|
static bool
|
||||||
do_reset (const SGPropertyNode * arg)
|
do_reset (const SGPropertyNode * arg)
|
||||||
{
|
{
|
||||||
fgReInitSubsystems();
|
fgResetIdleState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,7 +1072,7 @@ static bool
|
||||||
do_presets_commit (const SGPropertyNode * arg)
|
do_presets_commit (const SGPropertyNode * arg)
|
||||||
{
|
{
|
||||||
if (fgGetBool("/sim/initialized", false)) {
|
if (fgGetBool("/sim/initialized", false)) {
|
||||||
fgReInitSubsystems();
|
fgResetIdleState();
|
||||||
} else {
|
} else {
|
||||||
// Nasal can trigger this during initial init, which confuses
|
// Nasal can trigger this during initial init, which confuses
|
||||||
// the logic in ReInitSubsystems, since initial state has not been
|
// the logic in ReInitSubsystems, since initial state has not been
|
||||||
|
|
|
@ -849,89 +849,6 @@ void fgPostInitSubsystems()
|
||||||
globals->saveInitialState();
|
globals->saveInitialState();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset: this is what the 'reset' command (and hence, GUI) is attached to
|
|
||||||
void fgReInitSubsystems()
|
|
||||||
{
|
|
||||||
#ifdef NEW_RESET
|
|
||||||
fgResetIdleState();
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SGPropertyNode *master_freeze = fgGetNode("/sim/freeze/master");
|
|
||||||
|
|
||||||
SG_LOG( SG_GENERAL, SG_INFO, "fgReInitSubsystems()");
|
|
||||||
|
|
||||||
// setup state to begin re-init
|
|
||||||
bool freeze = master_freeze->getBoolValue();
|
|
||||||
if ( !freeze ) {
|
|
||||||
master_freeze->setBoolValue(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
fgSetBool("/sim/signals/reinit", true);
|
|
||||||
fgSetBool("/sim/crashed", false);
|
|
||||||
|
|
||||||
// do actual re-init steps
|
|
||||||
globals->get_subsystem("flight")->unbind();
|
|
||||||
|
|
||||||
// reset control state, before restoring initial state; -set or config files
|
|
||||||
// may specify values for flaps, trim tabs, magnetos, etc
|
|
||||||
globals->get_controls()->reset_all();
|
|
||||||
|
|
||||||
globals->restoreInitialState();
|
|
||||||
|
|
||||||
// update our position based on current presets
|
|
||||||
// this will mark position as needed finalized which we'll do in the
|
|
||||||
// main-loop
|
|
||||||
flightgear::initPosition();
|
|
||||||
|
|
||||||
simgear::SGTerraSync* terraSync =
|
|
||||||
static_cast<simgear::SGTerraSync*>(globals->get_subsystem("terrasync"));
|
|
||||||
if (terraSync) {
|
|
||||||
terraSync->reposition();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Force reupdating the positions of the ai 3d models. They are used for
|
|
||||||
// initializing ground level for the FDM.
|
|
||||||
globals->get_subsystem("ai-model")->reinit();
|
|
||||||
|
|
||||||
// Initialize the FDM
|
|
||||||
globals->get_subsystem("flight")->reinit();
|
|
||||||
|
|
||||||
// reset replay buffers
|
|
||||||
globals->get_subsystem("replay")->reinit();
|
|
||||||
|
|
||||||
// reload offsets from config defaults
|
|
||||||
globals->get_viewmgr()->reinit();
|
|
||||||
|
|
||||||
// ugly: finalizePosition waits for METAR to arrive for the new airport.
|
|
||||||
// we don't re-init the environment manager here, since historically we did
|
|
||||||
// not, and doing so seems to have other issues. All that's needed is to
|
|
||||||
// schedule METAR fetch immediately, so it's available for finalizePosition.
|
|
||||||
// So we manually extract the METAR-fetching component inside the environment
|
|
||||||
// manager, and re-init that.
|
|
||||||
SGSubsystemGroup* envMgr = static_cast<SGSubsystemGroup*>(globals->get_subsystem("environment"));
|
|
||||||
if (envMgr) {
|
|
||||||
envMgr->get_subsystem("realwx")->reinit();
|
|
||||||
}
|
|
||||||
|
|
||||||
globals->get_subsystem("time")->reinit();
|
|
||||||
|
|
||||||
// need to bind FDMshell again, since we manually unbound it above...
|
|
||||||
globals->get_subsystem("flight")->bind();
|
|
||||||
|
|
||||||
// need to reset aircraft (systems/instruments) so they can adapt to current environment
|
|
||||||
globals->get_subsystem("systems")->reinit();
|
|
||||||
globals->get_subsystem("instrumentation")->reinit();
|
|
||||||
|
|
||||||
// setup state to end re-init
|
|
||||||
fgSetBool("/sim/signals/reinit", false);
|
|
||||||
if ( !freeze ) {
|
|
||||||
master_freeze->setBoolValue(false);
|
|
||||||
}
|
|
||||||
fgSetBool("/sim/sceneryloaded",false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// re-position is a simplified version of the traditional (legacy)
|
// re-position is a simplified version of the traditional (legacy)
|
||||||
// reset procedure. We only need to poke systems which will be upset by
|
// reset procedure. We only need to poke systems which will be upset by
|
||||||
// a sudden change in aircraft position. Since this potentially includes
|
// a sudden change in aircraft position. Since this potentially includes
|
||||||
|
|
|
@ -62,9 +62,6 @@ void fgCreateSubsystems(bool duringReset);
|
||||||
// to peform final init
|
// to peform final init
|
||||||
void fgPostInitSubsystems();
|
void fgPostInitSubsystems();
|
||||||
|
|
||||||
// Reset: this is what the 'reset' command (and hence, GUI) is attached to
|
|
||||||
void fgReInitSubsystems();
|
|
||||||
|
|
||||||
// Re-position: when only location is changing, we can do considerably
|
// Re-position: when only location is changing, we can do considerably
|
||||||
// less work than a full re-init.
|
// less work than a full re-init.
|
||||||
void fgStartReposition();
|
void fgStartReposition();
|
||||||
|
|
Loading…
Reference in a new issue