[Scummvm-cvs-logs] SF.net SVN: scummvm: [27020] scummvm/trunk/common
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed May 30 20:39:36 CEST 2007
Revision: 27020
http://scummvm.svn.sourceforge.net/scummvm/?rev=27020&view=rev
Author: fingolfin
Date: 2007-05-30 11:39:35 -0700 (Wed, 30 May 2007)
Log Message:
-----------
AdvDetector changes: made upgradeTargetIfNecessary internal; cleanup to findGameID
Modified Paths:
--------------
scummvm/trunk/common/advancedDetector.cpp
scummvm/trunk/common/advancedDetector.h
Modified: scummvm/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp 2007-05-30 18:22:47 UTC (rev 27019)
+++ scummvm/trunk/common/advancedDetector.cpp 2007-05-30 18:39:35 UTC (rev 27020)
@@ -69,7 +69,7 @@
return GameList(params.list);
}
-void upgradeTargetIfNecessary(const Common::ADParams ¶ms) {
+static void upgradeTargetIfNecessary(const Common::ADParams ¶ms) {
if (params.obsoleteList == 0)
return;
@@ -97,25 +97,21 @@
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 @@
PluginError detectGameForEngineCreation(
const Common::ADParams ¶ms
) {
+
+ upgradeTargetIfNecessary(params);
+
Common::String gameid = ConfMan.get("gameid");
FSList fslist;
Modified: scummvm/trunk/common/advancedDetector.h
===================================================================
--- scummvm/trunk/common/advancedDetector.h 2007-05-30 18:22:47 UTC (rev 27019)
+++ scummvm/trunk/common/advancedDetector.h 2007-05-30 18:39:35 UTC (rev 27020)
@@ -207,9 +207,7 @@
const ADGameDescription *detectBestMatchingGame(const Common::ADParams ¶ms);
// FIXME/TODO: Rename this function to something more sensible.
-void upgradeTargetIfNecessary(const Common::ADParams ¶ms);
-
-// FIXME/TODO: Rename this function to something more sensible.
+// Only used by ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC
PluginError detectGameForEngineCreation(const Common::ADParams ¶ms);
@@ -237,7 +235,6 @@
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); \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list