]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Fix line endings
[flightgear.git] / src / Main / globals.cxx
index 487fa8fef3477f5d797d8fe762ffeb48eb671c9a..6a9b3f88cd92ca2355d5e79080a6d642a0eb7300 100644 (file)
 //
 // $Id$
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/structure/commands.hxx>
 #include <simgear/misc/sg_path.hxx>
 
 #include "globals.hxx"
+#include "renderer.hxx"
 #include "viewmgr.hxx"
 
 #include "fg_props.hxx"
@@ -81,6 +85,8 @@ FGGlobals::FGGlobals() :
     gslist( NULL ),
     dmelist( NULL ),
     mkrlist( NULL ),
+    tacanlist( NULL ),
+    carrierlist( NULL ), 
     fixlist( NULL )
 {
 }
@@ -97,11 +103,7 @@ FGGlobals::~FGGlobals()
     delete commands;
     delete io;
     delete renderer;
-  
-    // make sure only to delete the initial waypoints list if it acually
-    // still exists. 
-    if (initial_waypoints)
-        delete initial_waypoints;
+    delete initial_waypoints;
 }
 
 
@@ -115,7 +117,9 @@ void FGGlobals::set_fg_root (const string &root) {
     tmp.append( "version" );
     if ( ulFileExists( tmp.c_str() ) ) {
         fg_root += "/data";
-        }
+    }
+
+    fgSetString("/sim/fg-root", fg_root.c_str());   
 }
 
 void FGGlobals::set_fg_scenery (const string &scenery) {
@@ -155,6 +159,10 @@ void FGGlobals::set_fg_scenery (const string &scenery) {
                 ulCloseDir( od );
             }
         }
+        // insert a marker for FGTileEntry::load(), so that
+        // FG_SCENERY=A:B becomes list ["A/Terrain", "A/Objects", "",
+        // "B/Terrain", "B/Objects", ""]
+        fg_scenery.push_back("");
     }
 }