]> git.mxchange.org Git - flightgear.git/commitdiff
Progress towards testing
authorJames Turner <zakalawe@mac.com>
Thu, 10 Dec 2015 22:30:26 +0000 (16:30 -0600)
committerJames Turner <zakalawe@mac.com>
Thu, 10 Dec 2015 22:40:22 +0000 (16:40 -0600)
- remove route-manager from global variables

src/Airports/airportdynamicsmanager.hxx
src/Autopilot/route_mgr.hxx
src/Main/fg_init.cxx
src/Main/globals.cxx
src/Main/globals.hxx
src/Scenery/scenery.hxx
src/Scenery/tilemgr.hxx

index 26172dbdaaeb9b883b7c6a43485c4c4f52ac9409..8eb2fa6e48bf76ce5a891b14cfb902604e13fc8f 100644 (file)
@@ -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<std::string, FGAirportDynamicsRef> ICAODynamicsDict;
     ICAODynamicsDict m_dynamics;
index 696d43d618854f965fb24b4cb2889375e72a7fbe..e7df4be755be046c7e5797d134e47849ad259dbf 100644 (file)
@@ -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);
index 0b58c32cbe5165eaaf7755b825215275bdfa3264..785b2fa5c55cd20b864c24f7ea507c67be72e1fa 100644 (file)
@@ -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<FGRouteMgr>();
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the Input-Output subsystem
index 22d5eff46637fab14687fbd4c3fbe711904503f7..eedfd21bcb8e7587f244d8c97f2565d472452603 100644 (file)
@@ -50,7 +50,6 @@
 #include <Autopilot/route_mgr.hxx>
 #include <GUI/FGFontCache.hxx>
 #include <GUI/gui.h>
-#include <MultiPlayer/multiplaymgr.hxx>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <Navaids/navlist.hxx>
@@ -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<SGSoundMgr>();
 }
 
 SGEventMgr *
index 889fa40aabe5480c8948078e3e82fc1a3ec134e0..db882aee2833b841b244e62842efc99cb6f2ac00 100644 (file)
@@ -120,9 +120,6 @@ private:
     // Material properties library
     SGSharedPtr<SGMaterialLib> matlib;
 
-    // Global autopilot "route"
-    FGRouteMgr *route_mgr;
-
     // viewer manager
     FGViewMgr *viewmgr;
 
index e5ce65af7dcf8d2488fc013ee6884625f9760d3e..cc659882c28f706a694e303ab09c3fb62fe13a65 100644 (file)
@@ -126,6 +126,8 @@ public:
     static void resetPagerSingleton();
     
     flightgear::SceneryPager* getPager() { return _pager.get(); }
+
+    static const char* subsystemName() { return "scenery"; }
 };
 
 
index c84cbf5058849534bd0641dc768e64ee9259b79a..37c77888a52d0d79ee74724d61ff662c0eb9c260 100644 (file)
@@ -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"; }
 };