]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_init.cxx
Make magavr a regular subsystem.
[flightgear.git] / src / Main / fg_init.cxx
index 55d5581a55c89e55fc55dbfea50d66f82e38b96f..82793ac2bbb13af1a544aed4affa779b3d36be61 100644 (file)
@@ -60,7 +60,6 @@
 #include <simgear/misc/interpolator.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/scene/model/particles.hxx>
-#include <simgear/sound/soundmgr_openal.hxx>
 
 #include <Aircraft/controls.hxx>
 #include <Aircraft/replay.hxx>
@@ -81,6 +80,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>
@@ -97,6 +97,7 @@
 #include <Scenery/tilemgr.hxx>
 #include <Scripting/NasalSys.hxx>
 #include <Sound/voice.hxx>
+#include <Sound/soundmanager.hxx>
 #include <Systems/system_mgr.hxx>
 #include <Time/light.hxx>
 #include <Traffic/TrafficMgr.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);
@@ -1057,7 +1062,7 @@ bool fgInitSubsystems() {
     // to be updated in every loop.
     // Sound manager is updated last so it can use the CPU while the GPU
     // is processing the scenery (doubled the frame-rate for me) -EMH-
-    globals->add_subsystem("sound", new SGSoundMgr, SGSubsystemMgr::SOUND);
+    globals->add_subsystem("sound", new FGSoundManager, SGSubsystemMgr::SOUND);
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the event manager subsystem.
@@ -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