From 03aa642155b5b1a7866a91e6f8f49d6bc9fe8517 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 10 Mar 2014 12:03:34 +0000 Subject: [PATCH] Old reset code-path is removed. --- src/Main/fg_commands.cxx | 4 +- src/Main/fg_init.cxx | 83 ---------------------------------------- src/Main/fg_init.hxx | 3 -- 3 files changed, 2 insertions(+), 88 deletions(-) diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index f58e9317d..e936b3a38 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -205,7 +205,7 @@ do_exit (const SGPropertyNode * arg) static bool do_reset (const SGPropertyNode * arg) { - fgReInitSubsystems(); + fgResetIdleState(); return true; } @@ -1072,7 +1072,7 @@ static bool do_presets_commit (const SGPropertyNode * arg) { if (fgGetBool("/sim/initialized", false)) { - fgReInitSubsystems(); + fgResetIdleState(); } else { // Nasal can trigger this during initial init, which confuses // the logic in ReInitSubsystems, since initial state has not been diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 27878f7c0..d0022f6dd 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -849,89 +849,6 @@ void fgPostInitSubsystems() 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(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(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) // reset procedure. We only need to poke systems which will be upset by // a sudden change in aircraft position. Since this potentially includes diff --git a/src/Main/fg_init.hxx b/src/Main/fg_init.hxx index f61134c26..927ab9fdc 100644 --- a/src/Main/fg_init.hxx +++ b/src/Main/fg_init.hxx @@ -61,9 +61,6 @@ void fgCreateSubsystems(bool duringReset); // called after the subsystems have been bound and initialised, // to peform final init 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 // less work than a full re-init. -- 2.39.5