#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>
#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>
#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>
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()) {
fgLoadProps("preferences.xml", globals->get_props());
SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
- globals->loadUserSettings(dataPath);
+ // do not load user settings when reset to default is requested
+ if (flightgear::Options::sharedInstance()->isOptionSet("restore-defaults"))
+ {
+ SG_LOG(SG_ALL, SG_ALERT, "Ignoring user settings. Restoring defaults.");
+ }
+ else
+ {
+ globals->loadUserSettings(dataPath);
+ }
// Scan user config files and command line for a specified aircraft.
flightgear::Options::sharedInstance()->initAircraft();
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);
}
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);
// 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.
////////////////////////////////////////////////////////////////////
// Initialize the canvas 2d drawing subsystem.
////////////////////////////////////////////////////////////////////
- globals->add_subsystem("Canvas2D", new CanvasMgr, SGSubsystemMgr::DISPLAY);
+ globals->add_subsystem("Canvas", new CanvasMgr, SGSubsystemMgr::DISPLAY);
+ globals->add_subsystem("CanvasGUI", new GUIMgr, SGSubsystemMgr::DISPLAY);
////////////////////////////////////////////////////////////////////
// Initialise the ATIS Manager