mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-21 17:45:39 +00:00
Adv detector: Merged upgradeTargetIfNecessary() into detectGameForEngineCreation()
svn-id: r27144
This commit is contained in:
parent
5d46606bb0
commit
9e651592ec
@ -72,27 +72,6 @@ GameList gameIDList(const Common::ADParams ¶ms) {
|
||||
return GameList(params.list);
|
||||
}
|
||||
|
||||
static void upgradeTargetIfNecessary(const Common::ADParams ¶ms) {
|
||||
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 ¶ms
|
||||
@ -221,10 +200,24 @@ PluginError detectGameForEngineCreation(
|
||||
const Common::ADParams ¶ms
|
||||
) {
|
||||
|
||||
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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user