[Scummvm-cvs-logs] SF.net SVN: scummvm:[42444] scummvm/trunk/engines/advancedDetector.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Jul 13 20:31:42 CEST 2009


Revision: 42444
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42444&view=rev
Author:   lordhoto
Date:     2009-07-13 18:31:42 +0000 (Mon, 13 Jul 2009)

Log Message:
-----------
Support transparent guioptions update on game launch for AdvancedMetaEngine.

Modified Paths:
--------------
    scummvm/trunk/engines/advancedDetector.cpp

Modified: scummvm/trunk/engines/advancedDetector.cpp
===================================================================
--- scummvm/trunk/engines/advancedDetector.cpp	2009-07-13 17:48:13 UTC (rev 42443)
+++ scummvm/trunk/engines/advancedDetector.cpp	2009-07-13 18:31:42 UTC (rev 42444)
@@ -291,15 +291,24 @@
 		}
 	}
 
-	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 {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list