]> git.mxchange.org Git - flightgear.git/commitdiff
Make FGAircraftModel behave like a standarrd subsystem.
authorJames Turner <zakalawe@mac.com>
Sat, 2 Oct 2010 15:09:02 +0000 (16:09 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 5 Oct 2010 22:17:32 +0000 (23:17 +0100)
src/Main/fg_init.cxx
src/Main/globals.cxx
src/Main/main.cxx

index c62e96eafaf6e29aedb722a1975f20bec10bf49e..f1c542310228cd95025801fb754cc36aec8a1336 100644 (file)
@@ -1262,14 +1262,6 @@ bool fgInitGeneral() {
     return true;
 }
 
-// Initialize view parameters
-void fgInitView() {
-  // force update of model so that viewer can get some data...
-  globals->get_aircraft_model()->update(0);
-  // run update for current view so that data is current...
-  globals->get_viewmgr()->update(0);
-}
-
 // This is the top level init routine which calls all the other
 // initialization routines.  If you are adding a subsystem to flight
 // gear, its initialization call should located in this routine.
@@ -1355,12 +1347,6 @@ bool fgInitSubsystems() {
 
     globals->add_subsystem( "xml-autopilot", FGXMLAutopilotGroup::createInstance(), SGSubsystemMgr::FDM );
     globals->add_subsystem( "route-manager", new FGRouteMgr );
-    
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the view manager subsystem.
-    ////////////////////////////////////////////////////////////////////
-
-    fgInitView();
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the Input-Output subsystem
@@ -1542,8 +1528,6 @@ void fgReInitSubsystems()
     // reload offsets from config defaults
     globals->get_viewmgr()->reinit();
 
-    fgInitView();
-
     globals->get_controls()->reset_all();
 
     globals->get_subsystem("time")->reinit();
index c52c5e1823c68cf4cf6dbd39f5bc9b8d98e312f7..93755ced7198f81f0c9f5ac1709ccd0660b04a26 100644 (file)
@@ -189,7 +189,6 @@ FGGlobals::~FGGlobals()
     delete viewmgr;
 
 //     delete commands;
-    delete acmodel;
     delete model_mgr;
     delete channel_options_list;
     delete initial_waypoints;
index 294c39c924346f08b69da8c20327b12db2a7804a..1ed54dfe03a2b3dbd418f3c0a4d1288ba5037d09 100644 (file)
@@ -158,7 +158,6 @@ static void fgMainLoop( void ) {
 #endif  
     
     globals->get_subsystem_mgr()->update(sim_dt);
-    globals->get_aircraft_model()->update(sim_dt);
 
     // run Nasal's settimer() loops right before the view manager
     globals->get_event_mgr()->update(sim_dt);
@@ -404,9 +403,7 @@ static void fgIdleFunction ( void ) {
         ////////////////////////////////////////////////////////////////////
         FGAircraftModel* acm = new FGAircraftModel;
         globals->set_aircraft_model(acm);
-        //globals->add_subsystem("aircraft-model", acm);
-        acm->init();
-        acm->bind();
+        globals->add_subsystem("aircraft-model", acm, SGSubsystemMgr::DISPLAY);
 
         ////////////////////////////////////////////////////////////////////
         // Initialize the view manager subsystem.