aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-05-30 18:39:35 +0000
committerMax Horn2007-05-30 18:39:35 +0000
commit5006dbd932bb548b1f648a33576b22d8b5210c26 (patch)
treed2bf1206fc80093074ca5081943264ee5cb58a70
parent974dc86817712205b9d36f2441d7ed6790ea5dc6 (diff)
downloadscummvm-rg350-5006dbd932bb548b1f648a33576b22d8b5210c26.tar.gz
scummvm-rg350-5006dbd932bb548b1f648a33576b22d8b5210c26.tar.bz2
scummvm-rg350-5006dbd932bb548b1f648a33576b22d8b5210c26.zip
AdvDetector changes: made upgradeTargetIfNecessary internal; cleanup to findGameID
svn-id: r27020
-rw-r--r--common/advancedDetector.cpp19
-rw-r--r--common/advancedDetector.h5
2 files changed, 10 insertions, 14 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 84b8365584..7e53f4b921 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -69,7 +69,7 @@ GameList gameIDList(const Common::ADParams &params) {
return GameList(params.list);
}
-void upgradeTargetIfNecessary(const Common::ADParams &params) {
+static void upgradeTargetIfNecessary(const Common::ADParams &params) {
if (params.obsoleteList == 0)
return;
@@ -97,25 +97,21 @@ GameDescriptor findGameID(
const PlainGameDescriptor *g = params.list;
while (g->gameid) {
if (0 == scumm_stricmp(gameid, g->gameid))
- return *g;
+ return GameDescriptor(*g);
g++;
}
- GameDescriptor gs;
-
if (params.obsoleteList != 0) {
const Common::ADObsoleteGameID *o = params.obsoleteList;
while (o->from) {
if (0 == scumm_stricmp(gameid, o->from)) {
- gs["gameid"] = gameid;
- gs["description"] = "Obsolete game ID";
- return gs;
+ return GameDescriptor(gameid, "Obsolete game ID");
}
o++;
}
- } else
- return GameDescriptor(g->gameid, g->description);
- return gs;
+ }
+
+ return GameDescriptor();
}
static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGameDescriptor *sg) {
@@ -221,6 +217,9 @@ const ADGameDescription *detectBestMatchingGame(
PluginError detectGameForEngineCreation(
const Common::ADParams &params
) {
+
+ upgradeTargetIfNecessary(params);
+
Common::String gameid = ConfMan.get("gameid");
FSList fslist;
diff --git a/common/advancedDetector.h b/common/advancedDetector.h
index ec8249db83..82862d8ebf 100644
--- a/common/advancedDetector.h
+++ b/common/advancedDetector.h
@@ -207,9 +207,7 @@ GameList detectAllGames(const FSList &fslist, const Common::ADParams &params);
const ADGameDescription *detectBestMatchingGame(const Common::ADParams &params);
// FIXME/TODO: Rename this function to something more sensible.
-void upgradeTargetIfNecessary(const Common::ADParams &params);
-
-// FIXME/TODO: Rename this function to something more sensible.
+// Only used by ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC
PluginError detectGameForEngineCreation(const Common::ADParams &params);
@@ -237,7 +235,6 @@ PluginError detectGameForEngineCreation(const Common::ADParams &params);
PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \
assert(syst); \
assert(engine); \
- Common::AdvancedDetector::upgradeTargetIfNecessary(params); \
PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(params); \
if (err == kNoError) \
*engine = factoryFunc(syst); \