]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Removed FGEnvironmentMgr as a special case in globals, initialization,
[flightgear.git] / src / Main / globals.cxx
index 34432d99b64c31489015d38e72d766e5c7bc979f..7a0242c5392a307e3c667223d6a2a77411c2fead 100644 (file)
@@ -22,8 +22,7 @@
 
 
 #include <simgear/misc/commands.hxx>
-
-#include <Environment/environment_mgr.hxx>
+#include <simgear/misc/sg_path.hxx>
 
 #include "globals.hxx"
 #include "viewmgr.hxx"
@@ -56,9 +55,8 @@ FGGlobals::FGGlobals() :
     mag( NULL ),
     autopilot( NULL ),
     route( NULL ),
-    soundmgr( NULL ),
     current_panel( NULL ),
-    environment_mgr( NULL ),
+    soundmgr( NULL ),
     ATC_mgr( NULL ),
     ATC_display( NULL ),
     AI_mgr( NULL ),
@@ -68,8 +66,7 @@ FGGlobals::FGGlobals() :
     initial_state( NULL ),
     locale( NULL ),
     commands( new SGCommandMgr ),
-    model_loader( NULL ),
-    texture_loader( NULL ),
+    model_lib( NULL ),
     acmodel( NULL ),
     model_mgr( NULL ),
     channel_options_list( NULL ),
@@ -91,6 +88,20 @@ FGGlobals::~FGGlobals()
 }
 
 
+// set the fg_root path
+void FGGlobals::set_fg_root (const string &root) {
+    fg_root = root;
+    
+    // append /data to root if it exists
+    SGPath tmp( fg_root );
+    tmp.append( "data" );
+    tmp.append( "version" );
+    if ( ulFileExists( tmp.c_str() ) ) {
+        fg_root += "/data";
+        }
+}
+
+
 FGSubsystemMgr *
 FGGlobals::get_subsystem_mgr () const
 {