[Scummvm-cvs-logs] SF.net SVN: scummvm: [27966] scummvm/trunk/engines/scumm/detection.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jul 8 15:26:56 CEST 2007


Revision: 27966
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27966&view=rev
Author:   fingolfin
Date:     2007-07-08 06:26:55 -0700 (Sun, 08 Jul 2007)

Log Message:
-----------
SCUMM: Handle platform override a bit differently during startup; specifically, be more gentle if no perfect match against the specified platform value was found

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/detection.cpp

Modified: scummvm/trunk/engines/scumm/detection.cpp
===================================================================
--- scummvm/trunk/engines/scumm/detection.cpp	2007-07-08 13:01:00 UTC (rev 27965)
+++ scummvm/trunk/engines/scumm/detection.cpp	2007-07-08 13:26:55 UTC (rev 27966)
@@ -765,19 +765,22 @@
 	// narrow down the list a bit more.
 	if (results.size() > 1 && ConfMan.hasKey("platform")) {
 		Common::Platform platform = Common::parsePlatform(ConfMan.get("platform"));
+		Common::List<DetectorResult> tmp;
+
+		// Copy only those candidates which match the platform setting
 		for (Common::List<DetectorResult>::iterator x = results.begin(); x != results.end(); ) {
-			if (x->game.platform != platform) {
-				x = results.erase(x); 
-			} else {
-				++x;
+			if (x->game.platform == platform) {
+				tmp.push_back(*x);
 			}
 		}
-	}
 
-	// If we narrowed it down too much, abort
-	if (results.empty()) {
-		warning("Engine_SCUMM_create: Game data inconsistent with platform override");
-		return kNoGameDataFoundError;
+		// If we narrowed it down too much, print a warning, else use the list
+		// we just computed as new candidates list.
+		if (tmp.empty()) {
+			warning("Engine_SCUMM_create: Game data inconsistent with platform override");
+		} else {
+			results = tmp;
+		}
 	}
 
 	// Still no unique match found -> print a warning


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