[Scummvm-cvs-logs] scummvm master -> 2e2676526d97db7b1bff5be2838e4479aca3ba97

fingolfin max at quendi.de
Fri Jun 17 14:31:01 CEST 2011


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cef5506e9f SCI: Change fallback detector to use allFiles hashmap
055820c94b SCI: Improve fallback detection for GK2 demo
c2bbab4fec SCI: Improve fallback detection for KQ7
7c44582bb7 ENGINES: Update GameDescriptor::updateDesc docs to match reality
2e2676526d SCI: Improve 'extra' strings generated by fallback detector


Commit: cef5506e9f0ba328a064f058f074c979b8ba6485
    https://github.com/scummvm/scummvm/commit/cef5506e9f0ba328a064f058f074c979b8ba6485
Author: Max Horn (max at quendi.de)
Date: 2011-06-17T05:21:17-07:00

Commit Message:
SCI: Change fallback detector to use allFiles hashmap

Changed paths:
    engines/sci/detection.cpp



diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 10c27b2..038b086 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -430,56 +430,49 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
 	s_fallbackDesc.platform = Common::kPlatformPC;	// default to PC platform
 	s_fallbackDesc.gameid = "sci";
 
-	// First grab all filenames
-	// TODO: Consider using allFiles instead of fslist
-	for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
-		if (file->isDirectory())
-			continue;
-
-		Common::String filename = file->getName();
-		filename.toLowercase();
+	if (allFiles.contains("resource.map") || allFiles.contains("Data1")
+	    || allFiles.contains("resmap.001") || allFiles.contains("resmap.001")) {
+		foundResMap = true;
+	}
 
-		if (filename.contains("resource.map") || filename.contains("resmap.00") || filename.contains("Data1")) {
-			foundResMap = true;
+	// Determine if we got a CD version and set the CD flag accordingly, by checking for
+	// resource.aud for SCI1.1 CD games, or audio001.002 for SCI1 CD games. We assume that
+	// the file should be over 10MB, as it contains all the game speech and is usually
+	// around 450MB+. The size check is for some floppy game versions like KQ6 floppy, which
+	// also have a small resource.aud file
+	if (allFiles.contains("resource.aud") || allFiles.contains("audio001.002")) {
+		Common::FSNode file = allFiles.contains("resource.aud") ? allFiles["resource.aud"] :  allFiles["audio001.002"];
+		Common::SeekableReadStream *tmpStream = file.createReadStream();
+		if (tmpStream->size() > 10 * 1024 * 1024) {
+			// We got a CD version, so set the CD flag accordingly
+			s_fallbackDesc.flags |= ADGF_CD;
+			s_fallbackDesc.extra = "CD";
 		}
+		delete tmpStream;
+	}
 
-		// Determine if we got a CD version and set the CD flag accordingly, by checking for
-		// resource.aud for SCI1.1 CD games, or audio001.002 for SCI1 CD games. We assume that
-		// the file should be over 10MB, as it contains all the game speech and is usually
-		// around 450MB+. The size check is for some floppy game versions like KQ6 floppy, which
-		// also have a small resource.aud file
-		if (filename.contains("resource.aud") || filename.contains("audio001.002")) {
-			Common::SeekableReadStream *tmpStream = file->createReadStream();
-			if (tmpStream->size() > 10 * 1024 * 1024) {
-				// We got a CD version, so set the CD flag accordingly
-				s_fallbackDesc.flags |= ADGF_CD;
-				s_fallbackDesc.extra = "CD";
-			}
-			delete tmpStream;
-		}
+	if (allFiles.contains("resource.000") || allFiles.contains("resource.001")
+		|| allFiles.contains("ressci.000") || allFiles.contains("ressci.001"))
+		foundRes000 = true;
 
-		if (filename.contains("resource.000") || filename.contains("resource.001")
-			|| filename.contains("ressci.000") || filename.contains("ressci.001"))
-			foundRes000 = true;
+	// Data1 contains both map and volume for SCI1.1+ Mac games
+	if (allFiles.contains("Data1")) {
+		foundResMap = foundRes000 = true;
+		 s_fallbackDesc.platform = Common::kPlatformMacintosh;
+	}
 
-		// Data1 contains both map and volume for SCI1.1+ Mac games
-		if (filename.contains("Data1")) {
-			foundResMap = foundRes000 = true;
-			 s_fallbackDesc.platform = Common::kPlatformMacintosh;
-		}
+	// Determine the game platform
+	// The existence of any of these files indicates an Amiga game
+	if (allFiles.contains("9.pat") || allFiles.contains("spal") ||
+		allFiles.contains("patch.005") || allFiles.contains("bank.001"))
+			s_fallbackDesc.platform = Common::kPlatformAmiga;
 
-		// Determine the game platform
-		// The existence of any of these files indicates an Amiga game
-		if (filename.contains("9.pat") || filename.contains("spal") ||
-			filename.contains("patch.005") || filename.contains("bank.001"))
-				s_fallbackDesc.platform = Common::kPlatformAmiga;
+	// The existence of 7.pat or patch.200 indicates a Mac game
+	if (allFiles.contains("7.pat") || allFiles.contains("patch.200"))
+		s_fallbackDesc.platform = Common::kPlatformMacintosh;
 
-		// The existence of 7.pat or patch.200 indicates a Mac game
-		if (filename.contains("7.pat") || filename.contains("patch.200"))
-			s_fallbackDesc.platform = Common::kPlatformMacintosh;
+	// The data files for Atari ST versions are the same as their DOS counterparts
 
-		// The data files for Atari ST versions are the same as their DOS counterparts
-	}
 
 	// If these files aren't found, it can't be SCI
 	if (!foundResMap && !foundRes000) {


Commit: 055820c94b34eb948bb6f3cd7cec6697912ab794
    https://github.com/scummvm/scummvm/commit/055820c94b34eb948bb6f3cd7cec6697912ab794
Author: Max Horn (max at quendi.de)
Date: 2011-06-17T05:21:17-07:00

Commit Message:
SCI: Improve fallback detection for GK2 demo

Changed paths:
    engines/sci/detection.cpp



diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 038b086..03917a8 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -225,6 +225,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = {
 	{ "emc",		"funseeker",		SCI_VERSION_NONE     },
 	{ "gk",			"gk1",				SCI_VERSION_NONE     },
 	// gk2 is the same
+	{ "gk2demo",	"gk2",				SCI_VERSION_NONE     },
 	{ "hoyledemo",	"hoyle1",			SCI_VERSION_NONE     },
 	{ "cardgames",	"hoyle1",			SCI_VERSION_NONE     },
 	{ "solitare",	"hoyle2",			SCI_VERSION_NONE     },


Commit: c2bbab4fec7fa568d45984177035f2ef15da075b
    https://github.com/scummvm/scummvm/commit/c2bbab4fec7fa568d45984177035f2ef15da075b
Author: Max Horn (max at quendi.de)
Date: 2011-06-17T05:21:17-07:00

Commit Message:
SCI: Improve fallback detection for KQ7

Changed paths:
    engines/sci/detection.cpp



diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 03917a8..7d093a7 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -237,7 +237,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = {
 	{ "kq4",		"kq4sci",			SCI_VERSION_NONE     },
 	// kq5 is the same
 	// kq6 is the same
-	// kq7 is the same
+	{ "kq7cd",		"kq7",				SCI_VERSION_NONE     },
 	{ "mm1",		"laurabow",			SCI_VERSION_NONE     },
 	{ "cb1",		"laurabow",			SCI_VERSION_NONE     },
 	{ "lb2",		"laurabow2",		SCI_VERSION_NONE     },


Commit: 7c44582bb74bc3386040788b53d3ba27505723e7
    https://github.com/scummvm/scummvm/commit/7c44582bb74bc3386040788b53d3ba27505723e7
Author: Max Horn (max at quendi.de)
Date: 2011-06-17T05:21:18-07:00

Commit Message:
ENGINES: Update GameDescriptor::updateDesc docs to match reality

Changed paths:
    engines/game.cpp
    engines/game.h



diff --git a/engines/game.cpp b/engines/game.cpp
index c6d9905..c3a7454 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -69,9 +69,6 @@ void GameDescriptor::appendGUIOptions(const Common::String &str) {
 }
 
 void GameDescriptor::updateDesc(const char *extra) {
-	// TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone.
-	// We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or
-	// the seperator (instead of '/' use ', ' or ' ').
 	const bool hasCustomLanguage = (language() != Common::UNK_LANG);
 	const bool hasCustomPlatform = (platform() != Common::kPlatformUnknown);
 	const bool hasExtraDesc = (extra && extra[0]);
diff --git a/engines/game.h b/engines/game.h
index 3216cfb..1cf2c4b 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -64,7 +64,9 @@ public:
 				  uint32 guioptions = 0);
 
 	/**
-	 * Update the description string by appending (LANG/PLATFORM/EXTRA) to it.
+	 * Update the description string by appending (EXTRA/PLATFORM/LANG) to it.
+	 * Values that are missing are omitted, so e.g. (EXTRA/LANG) would be
+	 * added if no platform has been specified but a language and an extra string.
 	 */
 	void updateDesc(const char *extra = 0);
 


Commit: 2e2676526d97db7b1bff5be2838e4479aca3ba97
    https://github.com/scummvm/scummvm/commit/2e2676526d97db7b1bff5be2838e4479aca3ba97
Author: Max Horn (max at quendi.de)
Date: 2011-06-17T05:21:18-07:00

Commit Message:
SCI: Improve 'extra' strings generated by fallback detector

Changed paths:
    engines/sci/detection.cpp



diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 7d093a7..1cfedd6 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -325,7 +325,7 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R
 
 	for (const OldNewIdTableEntry *cur = s_oldNewTable; cur->oldId[0]; ++cur) {
 		if (sierraId == cur->oldId) {
-			// Distinguish same IDs from the SCI version
+			// Distinguish same IDs via the SCI version
 			if (cur->version != SCI_VERSION_NONE && cur->version != getSciVersion())
 				continue;
 
@@ -447,7 +447,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
 		if (tmpStream->size() > 10 * 1024 * 1024) {
 			// We got a CD version, so set the CD flag accordingly
 			s_fallbackDesc.flags |= ADGF_CD;
-			s_fallbackDesc.extra = "CD";
 		}
 		delete tmpStream;
 	}
@@ -550,22 +549,40 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
 	}
 
 
-	// Fill in extras field
+	// Fill in "extra" field
+
+	// Is this an EGA version that might have a VGA pendant? Then we want
+	// to mark it as such in the "extra" field.
+	const bool markAsEGA = (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga
+			&& getSciVersion() > SCI_VERSION_1_EGA_ONLY);
+
+	const bool isDemo = (s_fallbackDesc.flags & ADGF_DEMO);
+	const bool isCD = (s_fallbackDesc.flags & ADGF_CD);
 
 	if (gameId.hasSuffix("sci")) {
 		s_fallbackDesc.extra = "SCI";
 
 		// Differentiate EGA versions from the VGA ones, where needed
-		if (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga)
+		if (markAsEGA)
 			s_fallbackDesc.extra = "SCI/EGA";
+
+		// Mark as demo.
+		// Note: This overwrites the 'EGA' info, if it was previously set.
+		if (isDemo)
+			s_fallbackDesc.extra = "SCI/Demo";
 	} else {
-		if (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga)
+		if (markAsEGA)
 			s_fallbackDesc.extra = "EGA";
-	}
 
-	// Add "demo" to the description for demos
-	if (s_fallbackDesc.flags & ADGF_DEMO)
-		s_fallbackDesc.extra = (gameId.hasSuffix("sci")) ? "SCI/Demo" : "Demo";
+		// Set "CD" and "Demo" as appropriate.
+		// Note: This overwrites the 'EGA' info, if it was previously set.
+		if (isDemo && isCD)
+			s_fallbackDesc.extra = "CD Demo";
+		else if (isDemo)
+			s_fallbackDesc.extra = "Demo";
+		else if (isCD)
+			s_fallbackDesc.extra = "CD";
+	}
 
 	return (const ADGameDescription *)&s_fallbackDesc;
 }






More information about the Scummvm-git-logs mailing list