aboutsummaryrefslogtreecommitdiff
path: root/common/advancedDetector.cpp
diff options
context:
space:
mode:
authorMax Horn2007-06-06 18:35:37 +0000
committerMax Horn2007-06-06 18:35:37 +0000
commit9e651592ec9d58d8f5c0d2dea0e351bf048d2743 (patch)
treee11087ff9248895429e55d8a0db7d2420e88016d /common/advancedDetector.cpp
parent5d46606bb0d4d57f00655686e541f86593109799 (diff)
downloadscummvm-rg350-9e651592ec9d58d8f5c0d2dea0e351bf048d2743.tar.gz
scummvm-rg350-9e651592ec9d58d8f5c0d2dea0e351bf048d2743.tar.bz2
scummvm-rg350-9e651592ec9d58d8f5c0d2dea0e351bf048d2743.zip
Adv detector: Merged upgradeTargetIfNecessary() into detectGameForEngineCreation()
svn-id: r27144
Diffstat (limited to 'common/advancedDetector.cpp')
-rw-r--r--common/advancedDetector.cpp39
1 files changed, 16 insertions, 23 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 24e884a164..da65c30411 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -72,27 +72,6 @@ GameList gameIDList(const Common::ADParams &params) {
return GameList(params.list);
}
-static void upgradeTargetIfNecessary(const Common::ADParams &params) {
- if (params.obsoleteList == 0)
- return;
-
- const char *gameid = ConfMan.get("gameid").c_str();
-
- for (const Common::ADObsoleteGameID *o = params.obsoleteList; o->from; ++o) {
- if (!scumm_stricmp(gameid, o->from)) {
- gameid = o->to;
- ConfMan.set("gameid", o->to);
-
- if (o->platform != Common::kPlatformUnknown)
- ConfMan.set("platform", Common::getPlatformCode(o->platform));
-
- warning("Target upgraded from %s to %s", o->from, o->to);
- ConfMan.flushToDisk();
- break;
- }
- }
-}
-
GameDescriptor findGameID(
const char *gameid,
const Common::ADParams &params
@@ -221,10 +200,24 @@ PluginError detectGameForEngineCreation(
const Common::ADParams &params
) {
- upgradeTargetIfNecessary(params);
-
Common::String gameid = ConfMan.get("gameid");
+ if (params.obsoleteList != 0) {
+ for (const Common::ADObsoleteGameID *o = params.obsoleteList; o->from; ++o) {
+ if (!scumm_stricmp(gameid.c_str(), o->from)) {
+ gameid = o->to;
+ ConfMan.set("gameid", o->to);
+
+ if (o->platform != Common::kPlatformUnknown)
+ ConfMan.set("platform", Common::getPlatformCode(o->platform));
+
+ warning("Target upgraded from %s to %s", o->from, o->to);
+ ConfMan.flushToDisk();
+ break;
+ }
+ }
+ }
+
FSList fslist;
FilesystemNode dir(ConfMan.get("path"));
if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {