From: James Turner Date: Thu, 10 Dec 2015 22:30:26 +0000 (-0600) Subject: Progress towards testing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=43fcbd22463b32d95678edf920d7184055b2d63e;p=flightgear.git Progress towards testing - remove route-manager from global variables --- diff --git a/src/Airports/airportdynamicsmanager.hxx b/src/Airports/airportdynamicsmanager.hxx index 26172dbda..8eb2fa6e4 100644 --- a/src/Airports/airportdynamicsmanager.hxx +++ b/src/Airports/airportdynamicsmanager.hxx @@ -48,6 +48,8 @@ public: static FGAirportDynamicsRef find(const FGAirportRef& apt); FGAirportDynamicsRef dynamicsForICAO(const std::string& icao); + + static const char* subsystemName() { return "airport-dynamics"; } private: typedef std::map ICAODynamicsDict; ICAODynamicsDict m_dynamics; diff --git a/src/Autopilot/route_mgr.hxx b/src/Autopilot/route_mgr.hxx index 696d43d61..e7df4be75 100644 --- a/src/Autopilot/route_mgr.hxx +++ b/src/Autopilot/route_mgr.hxx @@ -100,6 +100,7 @@ public: flightgear::WayptRef waypointFromString(const std::string& target); + static const char* subsystemName() { return "route-manager"; } private: bool commandDefineUserWaypoint(const SGPropertyNode* arg); bool commandDeleteUserWaypoint(const SGPropertyNode* arg); diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 0b58c32cb..785b2fa5c 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -779,7 +779,7 @@ void fgCreateSubsystems(bool duringReset) { globals->add_subsystem( "xml-autopilot", FGXMLAutopilotGroup::createInstance("autopilot"), SGSubsystemMgr::FDM ); globals->add_subsystem( "xml-proprules", FGXMLAutopilotGroup::createInstance("property-rule"), SGSubsystemMgr::GENERAL ); - globals->add_subsystem( "route-manager", new FGRouteMgr ); + globals->add_new_subsystem(); //////////////////////////////////////////////////////////////////// // Initialize the Input-Output subsystem diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 22d5eff46..eedfd21bc 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -159,7 +158,6 @@ FGGlobals::FGGlobals() : fg_home( "" ), time_params( NULL ), ephem( NULL ), - route_mgr( NULL ), viewmgr( NULL ), commands( SGCommandMgr::instance() ), channel_options_list( NULL ), @@ -252,7 +250,7 @@ FGGlobals::~FGGlobals() delete time_params; set_matlib(NULL); - delete route_mgr; + delete channel_options_list; delete initial_waypoints; delete fontcache; @@ -529,10 +527,7 @@ FGGlobals::add_subsystem (const char * name, SGSoundMgr * FGGlobals::get_soundmgr () const { - if (subsystem_mgr) - return (SGSoundMgr*) subsystem_mgr->get_subsystem("sound"); - - return NULL; + return get_subsystem(); } SGEventMgr * diff --git a/src/Main/globals.hxx b/src/Main/globals.hxx index 889fa40aa..db882aee2 100644 --- a/src/Main/globals.hxx +++ b/src/Main/globals.hxx @@ -120,9 +120,6 @@ private: // Material properties library SGSharedPtr matlib; - // Global autopilot "route" - FGRouteMgr *route_mgr; - // viewer manager FGViewMgr *viewmgr; diff --git a/src/Scenery/scenery.hxx b/src/Scenery/scenery.hxx index e5ce65af7..cc659882c 100644 --- a/src/Scenery/scenery.hxx +++ b/src/Scenery/scenery.hxx @@ -126,6 +126,8 @@ public: static void resetPagerSingleton(); flightgear::SceneryPager* getPager() { return _pager.get(); } + + static const char* subsystemName() { return "scenery"; } }; diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index c84cbf505..37c77888a 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -116,6 +116,8 @@ public: // notify the tile manahger the material library was reloaded, // so it can pass this through to its options object void materialLibChanged(); + + static const char* subsystemName() { return "tile-mgr"; } };