]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_init.cxx
Interim windows build fix
[flightgear.git] / src / Main / fg_init.cxx
index 0b58c32cbe5165eaaf7755b825215275bdfa3264..572ca446a42382cdfca74ba6b032b3c9d1828979 100644 (file)
@@ -691,7 +691,7 @@ void fgCreateSubsystems(bool duringReset) {
     // to be updated in every loop.
     // Sound manager is updated last so it can use the CPU while the GPU
     // is processing the scenery (doubled the frame-rate for me) -EMH-
-    globals->add_subsystem("sound", new FGSoundManager, SGSubsystemMgr::SOUND);
+    globals->add_new_subsystem<FGSoundManager>(SGSubsystemMgr::SOUND);
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the event manager subsystem.
@@ -716,7 +716,7 @@ void fgCreateSubsystems(bool duringReset) {
     ////////////////////////////////////////////////////////////////////
     // Add the FlightGear property utilities.
     ////////////////////////////////////////////////////////////////////
-    globals->add_subsystem("airport-dynamics", new flightgear::AirportDynamicsManager);
+    globals->add_new_subsystem<flightgear::AirportDynamicsManager>();
 
     ////////////////////////////////////////////////////////////////////
     // Add the performance monitoring system.
@@ -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
@@ -897,10 +897,7 @@ void fgCreateSubsystems(bool duringReset) {
     globals->add_subsystem("aircraft-model", new FGAircraftModel, SGSubsystemMgr::DISPLAY);
     globals->add_subsystem("model-manager", new FGModelMgr, SGSubsystemMgr::DISPLAY);
 
-    globals->add_subsystem("view-manager", new FGViewMgr, SGSubsystemMgr::DISPLAY);
-
-    globals->add_subsystem("tile-manager", globals->get_tile_mgr(), 
-      SGSubsystemMgr::DISPLAY);
+    globals->add_new_subsystem<FGViewMgr>(SGSubsystemMgr::DISPLAY);
 }
 
 void fgPostInitSubsystems()
@@ -1027,7 +1024,7 @@ void fgStartNewReset()
         string_list::const_iterator it;
         for (it = names.begin(); it != names.end(); ++it) {
             if ((*it == "time") || (*it == "terrasync") || (*it == "events")
-                || (*it == "lighting"))
+                || (*it == "lighting") || (*it == FGTileMgr::subsystemName()) || (*it == FGScenery::subsystemName()))
             {
                 continue;
             }
@@ -1050,8 +1047,9 @@ void fgStartNewReset()
     
     // order is important here since tile-manager shutdown needs to
     // access the scenery object
-    globals->set_tile_mgr(NULL);
-    globals->set_scenery(NULL);
+    subsystemManger->remove(FGTileMgr::subsystemName());
+    subsystemManger->remove(FGScenery::subsystemName());
+
     FGScenery::getPagerSingleton()->clearRequests();
     flightgear::CameraGroup::setDefault(NULL);