aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/detection.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2018-02-01 08:03:39 +0100
committerEugene Sandulenko2018-02-01 08:03:39 +0100
commitc8975f9ba74002f0524d2dbb216a85dc97f5ce05 (patch)
treefb6ee9dced8d57dfbc0b7924749fa7a38a282c29 /engines/scumm/detection.cpp
parentffdb5a8ebc61770cb7ea11bbcbc45cc7e64c0f71 (diff)
downloadscummvm-rg350-c8975f9ba74002f0524d2dbb216a85dc97f5ce05.tar.gz
scummvm-rg350-c8975f9ba74002f0524d2dbb216a85dc97f5ce05.tar.bz2
scummvm-rg350-c8975f9ba74002f0524d2dbb216a85dc97f5ce05.zip
Revert "SCUMM: Check for and flag demos correctly"
There are too many regressions.
Diffstat (limited to 'engines/scumm/detection.cpp')
-rw-r--r--engines/scumm/detection.cpp67
1 files changed, 32 insertions, 35 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 0592d80120..0aa993a53a 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -489,45 +489,42 @@ static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameF
// Compute the precise game settings using gameVariantsTable.
for (const GameSettings *g = gameVariantsTable; g->gameid; ++g) {
- if (g->gameid[0] != 0 && scumm_stricmp(md5Entry->gameid, g->gameid)) continue;
- // The gameid either matches, or is empty. The latter indicates
- // a generic entry, currently used for some generic HE settings.
-
- if (g->variant != 0 && scumm_stricmp(md5Entry->variant, g->variant)) continue;
- // Variant matches too
-
- if (g->preferredTag != 0 && scumm_stricmp(md5Entry->extra, g->preferredTag)) continue;
- // OH, and do check the extra field in the entry too, otherwise we miss demos
-
- dr.game = *g;
- dr.game.gameid = md5Entry->gameid;
-
- // Set the platform value. The value from the MD5 record has
- // highest priority; if missing (i.e. set to unknown) we try
- // to use that from the filename pattern record instead.
- if (md5Entry->platform != Common::kPlatformUnknown) {
- dr.game.platform = md5Entry->platform;
- } else if (gfp->platform != Common::kPlatformUnknown) {
- dr.game.platform = gfp->platform;
- }
+ if (g->gameid[0] == 0 || !scumm_stricmp(md5Entry->gameid, g->gameid)) {
+ // The gameid either matches, or is empty. The latter indicates
+ // a generic entry, currently used for some generic HE settings.
+ if (g->variant == 0 || !scumm_stricmp(md5Entry->variant, g->variant)) {
+ // Perfect match found, use it and stop the loop
+ dr.game = *g;
+ dr.game.gameid = md5Entry->gameid;
+
+ // Set the platform value. The value from the MD5 record has
+ // highest priority; if missing (i.e. set to unknown) we try
+ // to use that from the filename pattern record instead.
+ if (md5Entry->platform != Common::kPlatformUnknown) {
+ dr.game.platform = md5Entry->platform;
+ } else if (gfp->platform != Common::kPlatformUnknown) {
+ dr.game.platform = gfp->platform;
+ }
- // HACK: Special case to distinguish the V1 demo from the full version
- // (since they have identical MD5):
- if (dr.game.id == GID_MANIAC && !strcmp(gfp->pattern, "%02d.MAN")) {
- dr.extra = "V1 Demo";
- dr.game.features = GF_DEMO;
- }
+ // HACK: Special case to distinguish the V1 demo from the full version
+ // (since they have identical MD5):
+ if (dr.game.id == GID_MANIAC && !strcmp(gfp->pattern, "%02d.MAN")) {
+ dr.extra = "V1 Demo";
+ dr.game.features = GF_DEMO;
+ }
- // HACK: Try to detect languages for translated games
- if (dr.language == UNK_LANG) {
- dr.language = detectLanguage(fslist, dr.game.id);
- }
+ // HACK: Try to detect languages for translated games
+ if (dr.language == UNK_LANG) {
+ dr.language = detectLanguage(fslist, dr.game.id);
+ }
- // HACK: Detect between 68k and PPC versions
- if (dr.game.platform == Common::kPlatformMacintosh && dr.game.version >= 5 && dr.game.heversion == 0 && strstr(gfp->pattern, "Data"))
- dr.game.features |= GF_MAC_CONTAINER;
+ // HACK: Detect between 68k and PPC versions
+ if (dr.game.platform == Common::kPlatformMacintosh && dr.game.version >= 5 && dr.game.heversion == 0 && strstr(gfp->pattern, "Data"))
+ dr.game.features |= GF_MAC_CONTAINER;
- break;
+ break;
+ }
+ }
}
}