]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_init.cxx
NavDisplay: fix update lag when switching range or centre.
[flightgear.git] / src / Main / fg_init.cxx
index 4a1881da96541b052571f76f6831a672369ab499..47ecbd4497de117ed2f817122316a1db00ddad62 100644 (file)
@@ -56,6 +56,7 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/structure/event_mgr.hxx>
+#include <simgear/structure/SGPerfMon.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/misc/sg_dir.hxx>
 #include <simgear/misc/sgstream.hxx>
@@ -501,7 +502,7 @@ static SGPath platformDefaultDataPath()
   
   SGPath appData;
   appData.set((const char*) path);
-  appData.append("flightgear.org");
+  appData.append("FlightGear");
   return appData;
 }
 #else
@@ -560,10 +561,10 @@ bool fgInitConfig ( int argc, char **argv )
             << "(from " << e.getOrigin() << ")");
       }
     }
-  
-  // Scan user config files and command line for a specified aircraft.
+
+    // Scan user config files and command line for a specified aircraft.
     flightgear::Options::sharedInstance()->initAircraft();
-      
+
     FindAndCacheAircraft f(&autosave);
     if (!f.loadAircraft()) {
       return false;
@@ -571,6 +572,10 @@ bool fgInitConfig ( int argc, char **argv )
 
     copyProperties(&autosave, globals->get_props());
 
+    // TODO Move some of the code above into loadUserSettings after the 2.6 release
+    // call dummy function, for now just to indicate that data was loaded
+    globals->loadUserSettings();
+
     // parse options after loading aircraft to ensure any user
     // overrides of defaults are honored.
     flightgear::Options::sharedInstance()->processOptions();
@@ -1180,6 +1185,15 @@ bool fgInitSubsystems() {
     SG_LOG( SG_GENERAL, SG_INFO, "Initialize Subsystems");
     SG_LOG( SG_GENERAL, SG_INFO, "========== ==========");
 
+    ////////////////////////////////////////////////////////////////////
+    // Initialize the sound subsystem.
+    ////////////////////////////////////////////////////////////////////
+    // Sound manager uses an own subsystem group "SOUND" which is the last
+    // 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 SGSoundMgr, SGSubsystemMgr::SOUND);
+
     ////////////////////////////////////////////////////////////////////
     // Initialize the event manager subsystem.
     ////////////////////////////////////////////////////////////////////
@@ -1199,6 +1213,14 @@ bool fgInitSubsystems() {
     ////////////////////////////////////////////////////////////////////
     globals->add_subsystem("properties", new FGProperties);
 
+
+    ////////////////////////////////////////////////////////////////////
+    // Add the performance monitoring system.
+    ////////////////////////////////////////////////////////////////////
+    globals->add_subsystem("performance-mon",
+            new SGPerformanceMonitor(globals->get_subsystem_mgr(),
+                                     fgGetNode("/sim/performance-monitor", true)));
+
     ////////////////////////////////////////////////////////////////////
     // Initialize the material property subsystem.
     ////////////////////////////////////////////////////////////////////
@@ -1282,7 +1304,7 @@ bool fgInitSubsystems() {
     // sub system infrastructure.
     ////////////////////////////////////////////////////////////////////
 
-    globals->add_subsystem("Old ATC", new FGATCMgr, SGSubsystemMgr::INIT);
+    globals->add_subsystem("ATC-old", new FGATCMgr, SGSubsystemMgr::INIT);
 
     ////////////////////////////////////////////////////////////////////
    // Initialize the ATC subsystem
@@ -1304,14 +1326,14 @@ bool fgInitSubsystems() {
     // Initialise the AI Model Manager
     ////////////////////////////////////////////////////////////////////
     SG_LOG(SG_GENERAL, SG_INFO, "  AI Model Manager");
-    globals->add_subsystem("ai_model", new FGAIManager, SGSubsystemMgr::POST_FDM);
-    globals->add_subsystem("submodel_mgr", new FGSubmodelMgr, SGSubsystemMgr::POST_FDM);
+    globals->add_subsystem("ai-model", new FGAIManager, SGSubsystemMgr::POST_FDM);
+    globals->add_subsystem("submodel-mgr", new FGSubmodelMgr, SGSubsystemMgr::POST_FDM);
 
 
     // It's probably a good idea to initialize the top level traffic manager
     // After the AI and ATC systems have been initialized properly.
     // AI Traffic manager
-    globals->add_subsystem("Traffic Manager", new FGTrafficManager, SGSubsystemMgr::POST_FDM);
+    globals->add_subsystem("traffic-manager", new FGTrafficManager, SGSubsystemMgr::POST_FDM);
 
     ////////////////////////////////////////////////////////////////////
     // Add a new 2D panel.
@@ -1446,7 +1468,7 @@ void fgReInitSubsystems()
     
     // Force reupdating the positions of the ai 3d models. They are used for
     // initializing ground level for the FDM.
-    globals->get_subsystem("ai_model")->reinit();
+    globals->get_subsystem("ai-model")->reinit();
 
     // Initialize the FDM
     globals->get_subsystem("flight")->reinit();