]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.hxx
Make magavr a regular subsystem.
[flightgear.git] / src / Main / globals.hxx
index 85292b58f6697df96f97f4cadbca676a07f5d895..7cc1813fc2ff546bed5b2e7206b3574a98165516 100644 (file)
@@ -46,7 +46,6 @@ typedef std::vector<std::string> string_list;
 
 class SGEphemeris;
 class SGCommandMgr;
-class SGMagVar;
 class SGMaterialLib;
 class SGPropertyNode;
 class SGTime;
@@ -65,7 +64,6 @@ class FGLocale;
 class FGModelMgr;
 class FGRouteMgr;
 class FGScenery;
-class FGPanel;
 class FGTileMgr;
 class FGViewMgr;
 class FGViewer;
@@ -99,6 +97,9 @@ private:
     // Root of FlightGear data tree
     std::string fg_root;
 
+    // Users home directory for data
+    std::string fg_home;
+
     // Roots of FlightGear scenery tree
     string_list fg_scenery;
 
@@ -110,18 +111,12 @@ private:
     // Sky structures
     SGEphemeris *ephem;
 
-    // Magnetic Variation
-    SGMagVar *mag;
-
     // Material properties library
     SGMaterialLib *matlib;
 
     // Global autopilot "route"
     FGRouteMgr *route_mgr;
 
-    // 2D panel
-    SGSharedPtr<FGPanel> current_panel;
-
     // ATC manager
     FGATISMgr *ATIS_mgr;
 
@@ -196,6 +191,9 @@ public:
     inline const std::string &get_fg_root () const { return fg_root; }
     void set_fg_root (const std::string &root);
 
+    inline const std::string &get_fg_home () const { return fg_home; }
+    void set_fg_home (const std::string &home);
+
     inline const string_list &get_fg_scenery () const { return fg_scenery; }
     void append_fg_scenery (const std::string &scenery);
 
@@ -219,6 +217,15 @@ public:
      */
     SGPath resolve_maybe_aircraft_path(const std::string& branch) const;
     
+    /**
+     * Search in the following directories:
+     *
+     *  1. Root directory of current aircraft (defined by /sim/aircraft-dir)
+     *  2. All aircraft directories if branch starts with Aircraft/
+     *  3. fg_data directory
+     */
+    SGPath resolve_ressource_path(const std::string& branch) const;
+
     inline const std::string &get_browser () const { return browser; }
     void set_browser (const std::string &b) { browser = b; }
 
@@ -234,18 +241,12 @@ public:
     inline SGEphemeris *get_ephem() const { return ephem; }
     inline void set_ephem( SGEphemeris *e ) { ephem = e; }
 
-    inline SGMagVar *get_mag() const { return mag; }
-    inline void set_mag( SGMagVar *m ) { mag = m; }
-
     inline SGMaterialLib *get_matlib() const { return matlib; }
     inline void set_matlib( SGMaterialLib *m ) { matlib = m; }
 
     inline FGATISMgr *get_ATIS_mgr() const { return ATIS_mgr; }
     inline void set_ATIS_mgr( FGATISMgr *a ) {ATIS_mgr = a; }
 
-    inline FGPanel *get_current_panel() const { return current_panel; }
-    void set_current_panel( FGPanel *cp );
-
     inline FGControls *get_controls() const { return controls; }
     inline void set_controls( FGControls *c ) { controls = c; }
 
@@ -267,7 +268,7 @@ public:
         acmodel = model;
     }
 
-    const SGGeod & get_aircraft_position() const;
+    SGGeod get_aircraft_position() const;
 
     SGVec3d get_aircraft_positon_cart() const;