From 209194ecba25283d620ad2a00fd617e54f656d0f Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Mon, 21 Mar 2016 11:50:11 +0100 Subject: [PATCH] Reload user preferences after reading the video configuration file --- src/Main/main.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index d17015589..0e683a69a 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -159,7 +159,10 @@ static void fgSetVideoOptions() if (path.exists()) { std::string renderer = fgGetString("/sim/rendering/gl-renderer"); - size_t pos = renderer.find('/'); + size_t pos = renderer.find("x86/"); + if (pos == std::string::npos) { + pos = renderer.find('/'); + } if (pos == std::string::npos) { pos = renderer.find(" ("); } @@ -176,6 +179,13 @@ static void fgSetVideoOptions() SG_LOG(SG_INPUT, SG_WARN, "failed to read video settings:" << e.getMessage() << "(from " << e.getOrigin() << ")"); } + + flightgear::Options* options = flightgear::Options::sharedInstance(); + if (!options->isOptionSet("ignore-autosave")) + { + SGPath dataPath = globals->get_fg_home(); + globals->loadUserSettings(dataPath); + } } } } -- 2.39.5