]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Improve timing statistics
[flightgear.git] / src / Main / globals.cxx
index aa34a9660959819bc7b4309266ac4b346cb02828..af4e693459bce2da14c45ce1e1ebd9342388142d 100644 (file)
@@ -35,6 +35,7 @@
 #include <simgear/structure/event_mgr.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/misc/ResourceManager.hxx>
+#include <simgear/props/propertyObject.hxx>
 
 #include <Aircraft/controls.hxx>
 #include <Airports/runways.hxx>
@@ -82,7 +83,7 @@ public:
         }
         
         if (r.exists()) {
-          SG_LOG(SG_IO, SG_INFO, "found path:" << aResource << " via /sim/aircraft-dir: " << r.str());
+          SG_LOG(SG_IO, SG_DEBUG, "found path:" << aResource << " via /sim/aircraft-dir: " << r.str());
           return r;
         }
     }
@@ -94,7 +95,7 @@ public:
     for (; it != dirs.end(); ++it) {
       SGPath p(*it, res);
       if (p.exists()) {
-        SG_LOG(SG_IO, SG_INFO, "found path:" << aResource << " in aircraft dir: " << *it);
+        SG_LOG(SG_IO, SG_DEBUG, "found path:" << aResource << " in aircraft dir: " << *it);
         return p;
       }
     } // of aircraft path iteration
@@ -122,8 +123,6 @@ FGGlobals::FGGlobals() :
     soundmgr( new SGSoundMgr ),
     sim_time_sec( 0.0 ),
     fg_root( "" ),
-    warp( 0 ),
-    warp_delta( 0 ),
     time_params( NULL ),
     ephem( NULL ),
     mag( NULL ),
@@ -150,6 +149,7 @@ FGGlobals::FGGlobals() :
     channellist( NULL )    
 {
   simgear::ResourceManager::instance()->addProvider(new AircraftResourceProvider());
+  simgear::PropertyObjectBase::setDefaultRoot(props);
 }
 
 
@@ -182,6 +182,7 @@ FGGlobals::~FGGlobals()
     delete current_panel;
 
     delete ATC_mgr;
+    controls->unbind();
     delete controls;
 
     delete channel_options_list;
@@ -401,4 +402,24 @@ FGGlobals::get_current_view () const
   return viewmgr->get_current_view();
 }
 
+long int FGGlobals::get_warp() const
+{
+  return fgGetInt("/sim/time/warp");
+}
+
+void FGGlobals::set_warp( long int w )
+{
+  fgSetInt("/sim/time/warp", w);
+}
+
+long int FGGlobals::get_warp_delta() const
+{
+  return fgGetInt("/sim/time/warp-delta");
+}
+
+void FGGlobals::set_warp_delta( long int d )
+{
+  fgSetInt("/sim/time/warp-delta", d);
+}
+    
 // end of globals.cxx