aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/detection.cpp')
-rw-r--r--engines/scumm/detection.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index aecd13db5a..18f2f4ddec 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -272,7 +272,7 @@ static BaseScummFile *openDiskImage(const Common::FSNode &node, const GameFilena
GameSettings gs;
memset(&gs, 0, sizeof(GameSettings));
gs.gameid = gfp->gameid;
- gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK);
+ gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK);
gs.platform = gfp->platform;
// determine second disk file name
@@ -431,7 +431,7 @@ static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameF
}
}
-static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map, int depth, const char **globs) {
+static void composeFileHashMap(DescMap &fileMD5Map, const Common::FSList &fslist, int depth, const char **globs) {
if (depth <= 0)
return;
@@ -454,14 +454,13 @@ static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map
matched = true;
break;
}
-
+
if (!matched)
continue;
Common::FSList files;
-
if (file->getChildren(files, Common::FSNode::kListAll)) {
- composeFileHashMap(files, fileMD5Map, depth - 1, globs);
+ composeFileHashMap(fileMD5Map, files, depth - 1, globs);
}
}
}
@@ -472,7 +471,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
DetectorResult dr;
// Dive one level down since mac indy3/loom has its files split into directories. See Bug #1438631
- composeFileHashMap(fslist, fileMD5Map, 2, directoryGlobs);
+ composeFileHashMap(fileMD5Map, fslist, 2, directoryGlobs);
// Iterate over all filename patterns.
for (const GameFilenamePattern *gfp = gameFilenamesTable; gfp->gameid; ++gfp) {
@@ -516,7 +515,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
if (d.md5.empty()) {
Common::SeekableReadStream *tmp = 0;
bool isDiskImg = (file.hasSuffix(".d64") || file.hasSuffix(".dsk") || file.hasSuffix(".prg"));
-
+
if (isDiskImg) {
tmp = openDiskImage(d.node, gfp);
@@ -882,7 +881,7 @@ GameList ScummMetaEngine::getSupportedGames() const {
}
GameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
- return AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
+ return Engines::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
}
static Common::String generatePreferredTarget(const DetectorResult &x) {
@@ -975,20 +974,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co
// We start by checking whether the specified game ID is obsolete.
// If that is the case, we automatically upgrade the target to use
// the correct new game ID (and platform, if specified).
- for (const ADObsoleteGameID *o = obsoleteGameIDsTable; o->from; ++o) {
- if (!scumm_stricmp(gameid, o->from)) {
- // Match found, perform upgrade
- gameid = o->to;
- ConfMan.set("gameid", o->to);
-
- if (o->platform != Common::kPlatformUnknown)
- ConfMan.set("platform", Common::getPlatformCode(o->platform));
-
- warning("Target upgraded from game ID %s to %s", o->from, o->to);
- ConfMan.flushToDisk();
- break;
- }
- }
+ Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
// Fetch the list of files in the current directory
Common::FSList fslist;