diff options
author | Johannes Schickel | 2009-07-13 18:31:42 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-07-13 18:31:42 +0000 |
commit | 1871a2e68d377b45a3b065875faa2dd899e2d301 (patch) | |
tree | 8c3fec7587436e143cd4e32008586c88e8112d07 | |
parent | 43c7f7530a3320311294c7087d652588b137a03e (diff) | |
download | scummvm-rg350-1871a2e68d377b45a3b065875faa2dd899e2d301.tar.gz scummvm-rg350-1871a2e68d377b45a3b065875faa2dd899e2d301.tar.bz2 scummvm-rg350-1871a2e68d377b45a3b065875faa2dd899e2d301.zip |
Support transparent guioptions update on game launch for AdvancedMetaEngine.
svn-id: r42444
-rw-r--r-- | engines/advancedDetector.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index c127faec28..d1395fbe04 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -291,15 +291,24 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) } } - if (agdDesc == 0) { + if (agdDesc == 0) return Common::kNoGameDataFoundError; + + // If the GUI options were updated, we catch this here and update them in the users config + // file transparently. + const uint32 guiOptions = agdDesc->guioptions | params.guioptions; + + if ((guiOptions && !ConfMan.hasKey("guioptions")) || + (ConfMan.hasKey("guioptions") && parseGameGUIOptions(ConfMan.get("guioptions")) != guiOptions)) { + ConfMan.set("guioptions", Common::getGameGUIOptionsDescription(guiOptions)); + ConfMan.flushToDisk(); } debug(2, "Running %s", toGameDescriptor(*agdDesc, params.list).description().c_str()); - if (!createInstance(syst, engine, agdDesc)) { + if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; - } - return Common::kNoError; + else + return Common::kNoError; } struct SizeMD5 { |