From 2fd0877824e591bded621b2251231ac508b3535a Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Mon, 13 Apr 2020 17:03:37 +0200 Subject: [PATCH] Only load the video settings when the autosave file is not found. This requires the properties in the video settings configuration file to have the archive attribute set but it solves the problem of loading the autosave file twice (and too late in the process) --- src/Main/main.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 9727d9a29..6b1b24ccf 100755 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -218,6 +218,10 @@ static void initTerrasync() static void fgSetVideoOptions() { + SGPath userDataPath = globals->get_fg_home(); + SGPath autosaveFile = globals->autosaveFilePath(userDataPath); + if (autosaveFile.exists()) return; + std::string vendor = fgGetString("/sim/rendering/gl-vendor"); SGPath path(globals->get_fg_root()); path.append("Video"); @@ -245,11 +249,6 @@ 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")) { - globals->loadUserSettings(); - } } } }