]> git.mxchange.org Git - flightgear.git/commitdiff
Old reset code-path is removed.
authorJames Turner <zakalawe@mac.com>
Mon, 10 Mar 2014 12:03:34 +0000 (12:03 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 10 Mar 2014 17:24:37 +0000 (17:24 +0000)
src/Main/fg_commands.cxx
src/Main/fg_init.cxx
src/Main/fg_init.hxx

index f58e9317d1330b5eea48e17e6c51e38989cf76f5..e936b3a383919cb1c65a1c88fc4d248db77ed45e 100644 (file)
@@ -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
index 27878f7c00b84222349712762e3576d16119e5cd..d0022f6dd50626fffcd1e8a30817c1cdc0b366c9 100644 (file)
@@ -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<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)
 // reset procedure. We only need to poke systems which will be upset by
 // a sudden change in aircraft position. Since this potentially includes
index f61134c26c8a3bbbb163a6030d30a0440bd3e5ca..927ab9fdc2296cf33dadb3cf6ec0cf797c501ae1 100644 (file)
@@ -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.