From d39841d2dfdf82e1d590ab331888e3a392d199c6 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 2 Oct 2010 16:09:02 +0100 Subject: [PATCH] Make FGAircraftModel behave like a standarrd subsystem. --- src/Main/fg_init.cxx | 16 ---------------- src/Main/globals.cxx | 1 - src/Main/main.cxx | 5 +---- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index c62e96eaf..f1c542310 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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(); diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index c52c5e182..93755ced7 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -189,7 +189,6 @@ FGGlobals::~FGGlobals() delete viewmgr; // delete commands; - delete acmodel; delete model_mgr; delete channel_options_list; delete initial_waypoints; diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 294c39c92..1ed54dfe0 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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. -- 2.39.2