]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_init.cxx
Push SGMaterial use into these classes that need it.
[flightgear.git] / src / Main / fg_init.cxx
index 55d5581a55c89e55fc55dbfea50d66f82e38b96f..651b0d4438ecdbfa064dbbd63fa3fd329c26431c 100644 (file)
@@ -81,6 +81,7 @@
 #include <Cockpit/panel_io.hxx>
 
 #include <Canvas/canvas_mgr.hxx>
+#include <Canvas/gui_mgr.hxx>
 #include <GUI/new_gui.hxx>
 #include <Input/input.hxx>
 #include <Instrumentation/instrument_mgr.hxx>
@@ -405,6 +406,8 @@ bool fgInitConfig ( int argc, char **argv )
     const char *fg_home = getenv("FG_HOME");
     if (fg_home)
       dataPath = fg_home;
+      
+    globals->set_fg_home(dataPath.c_str());
     
     simgear::Dir exportDir(simgear::Dir(dataPath).file("Export"));
     if (!exportDir.exists()) {
@@ -587,8 +590,8 @@ static bool fgSetPosFromAirportIDandParkpos( const string& id, const string& par
         string fltType;
         string acOperator;
         SGPath acData;
-        try {
-            acData = fgGetString("/sim/fg-home");
+        try {          
+            acData = globals->get_fg_home();
             acData.append("aircraft-data");
             string acfile = fgGetString("/sim/aircraft") + string(".xml");
             acData.append(acfile);
@@ -1027,7 +1030,9 @@ bool fgInitGeneral() {
     }
     SG_LOG( SG_GENERAL, SG_INFO, "FG_ROOT = " << '"' << root << '"' << endl );
 
-    globals->set_browser(fgGetString("/sim/startup/browser-app", "firefox %u"));
+    // Note: browser command is hard-coded for Mac/Windows, so this only affects other platforms
+    globals->set_browser(fgGetString("/sim/startup/browser-app", WEB_BROWSER));
+    fgSetString("/sim/startup/browser-app", globals->get_browser());
 
     simgear::Dir cwd(simgear::Dir::current());
     SGPropertyNode *curr = fgGetNode("/sim", true);
@@ -1164,6 +1169,7 @@ bool fgInitSubsystems() {
     // Initialize the canvas 2d drawing subsystem.
     ////////////////////////////////////////////////////////////////////
     globals->add_subsystem("Canvas", new CanvasMgr, SGSubsystemMgr::DISPLAY);
+    globals->add_subsystem("CanvasGUI", new GUIMgr, SGSubsystemMgr::DISPLAY);
 
     ////////////////////////////////////////////////////////////////////
     // Initialise the ATIS Manager