aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2011-06-14 15:25:33 +0200
committerMax Horn2011-06-14 18:52:07 +0200
commit593b929047434eefa9b6dfb73730f7d502c4ff10 (patch)
tree84fcfdd28ec336bf00f2969ff545e5a686ebd98d /engines/scumm
parent6412d091268d299f7f4d31382b0e4e9e4e352ad9 (diff)
downloadscummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.tar.gz
scummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.tar.bz2
scummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.zip
DETECTOR: Separate code for handling obsolete gameids from advanced detector
This includes a renaming of ADObsoleteGameID to Engine::ObsoleteGameID, and AdvancedDetector::findGameID now is Engines::findGameID. Doxygen comments were added or improved
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/detection.cpp17
-rw-r--r--engines/scumm/detection_tables.h4
2 files changed, 4 insertions, 17 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index aecd13db5a..4b673ad8ff 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -882,7 +882,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 +975,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;
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 7eb1e80132..e510c46cf2 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -23,7 +23,7 @@
#ifndef SCUMM_DETECTION_TABLES_H
#define SCUMM_DETECTION_TABLES_H
-#include "engines/advancedDetector.h"
+#include "engines/obsolete.h"
#include "common/rect.h"
#include "common/util.h"
@@ -145,7 +145,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
* Conversion table mapping old obsolete game IDs to the
* corresponding new game ID and platform combination.
*/
-static const ADObsoleteGameID obsoleteGameIDsTable[] = {
+static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
{"bluesabctimedemo", "bluesabctime", UNK},
{"BluesBirthdayDemo", "BluesBirthday", UNK},
{"comidemo", "comi", UNK},