[Scummvm-cvs-logs] SF.net SVN: scummvm: [25194] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Jan 25 22:16:58 CET 2007


Revision: 25194
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25194&view=rev
Author:   fingolfin
Date:     2007-01-25 13:16:57 -0800 (Thu, 25 Jan 2007)

Log Message:
-----------
Lots of cleanup in the AdvancedDetector

Modified Paths:
--------------
    scummvm/trunk/common/advancedDetector.cpp
    scummvm/trunk/common/advancedDetector.h
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agos/game.cpp
    scummvm/trunk/engines/cine/detection.cpp
    scummvm/trunk/engines/kyra/plugin.cpp
    scummvm/trunk/engines/parallaction/detection.cpp
    scummvm/trunk/engines/saga/game.cpp

Modified: scummvm/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/common/advancedDetector.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -33,6 +33,8 @@
 
 namespace Common {
 
+namespace AdvancedDetector {
+
 /**
  * Detect games in specified directory.
  * Parameters language and platform are used to pass on values
@@ -48,28 +50,33 @@
 static ADList detectGame(const FSList *fslist, const Common::ADParams &params, Language language, Platform platform);
 
 
-PluginError ADVANCED_DETECTOR_ENGINE_CREATE(
-	GameList (*detectFunc)(const FSList &fslist),
-	const Common::ADParams &params
-	) {
+void upgradeTargetIfNecessary(const Common::ADParams &params) {
+	if (params.obsoleteList == 0)
+		return;
+
 	const char *gameid = ConfMan.get("gameid").c_str();
 
-	if (params.obsoleteList != 0) {
-		for (const Common::ADObsoleteGameID *o = params.obsoleteList; o->from; ++o) {
-			if (!scumm_stricmp(gameid, o->from)) {
-				gameid = o->to;
-				ConfMan.set("gameid", o->to);
+	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));
+			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;
-			}
+			warning("Target upgraded from %s to %s", o->from, o->to);
+			ConfMan.flushToDisk();
+			break;
 		}
 	}
+}
 
+PluginError detectGameForEngineCreation(
+	GameList (*detectFunc)(const FSList &fslist),
+	const Common::ADParams &params
+	) {
+	Common::String gameid = ConfMan.get("gameid");
+
 	FSList fslist;
 	FilesystemNode dir(ConfMan.get("path"));
 	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
@@ -87,7 +94,7 @@
 	return kNoGameDataFoundError;
 }
 
-GameDescriptor ADVANCED_DETECTOR_FIND_GAMEID(
+GameDescriptor findGameID(
 	const char *gameid,
 	const Common::ADParams &params
 	) {
@@ -128,7 +135,7 @@
 	return gd;
 }
 
-GameList ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(
+GameList detectAllGames(
 	const FSList &fslist,
 	const Common::ADParams &params
 	) {
@@ -141,7 +148,7 @@
 	return detectedGames;
 }
 
-int ADVANCED_DETECTOR_DETECT_INIT_GAME(
+int detectBestMatchingGame(
 	const Common::ADParams &params
 	) {
 	Common::Language language = Common::UNK_LANG;
@@ -164,9 +171,7 @@
 		}
 	}
 
-	if (gameNumber < 0) {
-		error("ADVANCED_DETECTOR_DETECT_INIT_GAME: no match found (TODO: Let the caller handle this)");
-	} else {
+	if (gameNumber >= 0) {
 		debug(2, "Running %s", toGameDescriptor(*(const ADGameDescription *)(params.descs + gameNumber * params.descItemSize), params.list).description().c_str());
 	}
 
@@ -340,4 +345,6 @@
 	return matched;
 }
 
+}	// End of namespace AdvancedDetector
+
 }	// End of namespace Common

Modified: scummvm/trunk/common/advancedDetector.h
===================================================================
--- scummvm/trunk/common/advancedDetector.h	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/common/advancedDetector.h	2007-01-25 21:16:57 UTC (rev 25194)
@@ -70,38 +70,58 @@
 #define AD_ENTRY1(f, x) {{ f, 0, x, -1}, {NULL, 0, NULL, 0}}
 
 
-// FIXME/TODO: Rename this function to something more sensible.
-GameDescriptor ADVANCED_DETECTOR_FIND_GAMEID(
+namespace AdvancedDetector {
+
+/**
+ * Scan through the game descriptors specified in params and search for
+ * 'gameid' in there. If a match is found, returns a  GameDescriptor
+ * with gameid and description set.
+ */
+GameDescriptor findGameID(
 	const char *gameid,
 	const Common::ADParams &params
 	);
 
 
 // FIXME/TODO: Rename this function to something more sensible.
-GameList ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(
+GameList detectAllGames(
 	const FSList &fslist,
 	const Common::ADParams &params
 	);
 
 
 // FIXME/TODO: Rename this function to something more sensible.
-int ADVANCED_DETECTOR_DETECT_INIT_GAME(
+int detectBestMatchingGame(
 	const Common::ADParams &params
 	);
 
 // FIXME/TODO: Rename this function to something more sensible.
-PluginError ADVANCED_DETECTOR_ENGINE_CREATE(
+void upgradeTargetIfNecessary(const Common::ADParams &params);
+
+// FIXME/TODO: Rename this function to something more sensible.
+PluginError detectGameForEngineCreation(
 	GameList (*detectFunc)(const FSList &fslist),
 	const Common::ADParams &params
 	);
 
 
-#define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,detectFunc,params) \
+// FIXME: It would probably be good to merge detectBestMatchingGame
+// and detectGameForEngineCreation into a single function. Right now, the
+// detection code called priort to creating an engine instance
+// (i.e. detectGameForEngineCreation) differs from the detection code the 
+// engines call internally (i.e. detectBestMatchingGame). This could lead
+// to hard to debug and odd errors.
+
+
+} // End of namespace AdvancedDetector
+
+
+#define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,factoryFunc,detectFunc,params) \
 	GameList Engine_##engine##_gameIDList() { \
 		return GameList(params.list); \
 	} \
 	GameDescriptor Engine_##engine##_findGameID(const char *gameid) { \
-		return Common::ADVANCED_DETECTOR_FIND_GAMEID(gameid, params); \
+		return Common::AdvancedDetector::findGameID(gameid, params); \
 	} \
 	GameList Engine_##engine##_detectGames(const FSList &fslist) { \
 		return detectFunc(fslist);						\
@@ -109,14 +129,22 @@
 	PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \
 		assert(syst); \
 		assert(engine); \
-		PluginError err = ADVANCED_DETECTOR_ENGINE_CREATE(detectFunc, params); \
+		Common::AdvancedDetector::upgradeTargetIfNecessary(params); \
+		PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(detectFunc, params); \
 		if (err == kNoError) \
-			*engine = new className(syst); \
+			*engine = factoryFunc(syst); \
 		return err; \
 	} \
 	void dummyFuncToAllowTrailingSemicolon()
 
+#define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,detectFunc,params) \
+	static className *engine##_createInstance(OSystem *syst) { \
+		return new className(syst); \
+	} \
+	ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,engine##_createInstance,detectFunc,params); \
+	void dummyFuncToAllowTrailingSemicolon()
 
+
 }	// End of namespace Common
 
 #endif

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/engines/agi/detection.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -981,14 +981,16 @@
 namespace Agi {
 
 bool AgiEngine::initGame() {
-	int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+	int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+	if (i < 0)
+		return false;
 
 	_gameDescription = &gameDescriptions[i];
 	return true;
 }
 
 GameList GAME_detectGames(const FSList &fslist) {
-	return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
+	return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
 }
 
 } // End of namespace Agi

Modified: scummvm/trunk/engines/agos/game.cpp
===================================================================
--- scummvm/trunk/engines/agos/game.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/engines/agos/game.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -102,14 +102,16 @@
 namespace AGOS {
 
 bool AGOSEngine::initGame() {
-	int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+	int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+	if (i < 0)
+		return false;
 
 	_gameDescription = &gameDescriptions[i];
 	return true;
 }
 
 GameList GAME_detectGames(const FSList &fslist) {
-	return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
+	return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
 }
 
 int AGOSEngine::getGameId() const {

Modified: scummvm/trunk/engines/cine/detection.cpp
===================================================================
--- scummvm/trunk/engines/cine/detection.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/engines/cine/detection.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -450,14 +450,16 @@
 namespace Cine {
 
 bool CineEngine::initGame() {
-	int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+	int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+	if (i < 0)
+		return false;
 
 	_gameDescription = &gameDescriptions[i];
 	return true;
 }
 
 GameList GAME_detectGames(const FSList &fslist) {
-	return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
+	return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
 }
 
 } // End of namespace Cine

Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/engines/kyra/plugin.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -28,50 +28,47 @@
 
 #include "base/plugins.h"
 
-using namespace Kyra;
-using namespace Common;
-
 struct KYRAGameDescription {
 	Common::ADGameDescription desc;
 
-	GameFlags flags;
+	Kyra::GameFlags flags;
 };
 
 namespace {
 
-#define FLAGS(x, y, z, w, id) { UNK_LANG, kPlatformUnknown, x, y, z, w, id }
+#define FLAGS(x, y, z, w, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, w, id }
 
-#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, GI_KYRA1)
-#define KYRA1_TOWNS_FLAGS FLAGS(false, true, true, false, GI_KYRA1)
-#define KYRA1_CD_FLAGS FLAGS(false, true, false, true, GI_KYRA1)
-#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, GI_KYRA1)
+#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_FLAGS FLAGS(false, true, true, false, Kyra::GI_KYRA1)
+#define KYRA1_CD_FLAGS FLAGS(false, true, false, true, Kyra::GI_KYRA1)
+#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, Kyra::GI_KYRA1)
 
-#define KYRA2_UNK_FLAGS FLAGS(false, false, false, false, GI_KYRA2)
+#define KYRA2_UNK_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA2)
 
-#define KYRA3_CD_FLAGS FLAGS(false, false, false, true, GI_KYRA3)
+#define KYRA3_CD_FLAGS FLAGS(false, false, false, true, Kyra::GI_KYRA3)
 
 static const KYRAGameDescription adGameDescs[] = {
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "3c244298395520bb62b5edfe41688879"), EN_ANY, kPlatformPC }, KYRA1_FLOPPY_FLAGS },
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "796e44863dd22fa635b042df1bf16673"), EN_ANY, kPlatformPC }, KYRA1_FLOPPY_FLAGS },
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "abf8eb360e79a6c2a837751fbd4d3d24"), FR_FRA, kPlatformPC }, KYRA1_FLOPPY_FLAGS },
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "6018e1dfeaca7fe83f8d0b00eb0dd049"), DE_DEU, kPlatformPC }, KYRA1_FLOPPY_FLAGS },
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "f0b276781f47c130f423ec9679fe9ed9"), DE_DEU, kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // from Arne.F
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "8909b41596913b3f5deaf3c9f1017b01"), ES_ESP, kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // from VooD
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "747861d2a9c643c59fdab570df5b9093"), ES_ESP, kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // floppy 1.8 from clemmy
-	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "ef08c8c237ee1473fd52578303fc36df"), IT_ITA, kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // from gourry
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "3c244298395520bb62b5edfe41688879"), Common::EN_ANY, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS },
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "796e44863dd22fa635b042df1bf16673"), Common::EN_ANY, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS },
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "abf8eb360e79a6c2a837751fbd4d3d24"), Common::FR_FRA, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS },
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "6018e1dfeaca7fe83f8d0b00eb0dd049"), Common::DE_DEU, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS },
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "f0b276781f47c130f423ec9679fe9ed9"), Common::DE_DEU, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // from Arne.F
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "8909b41596913b3f5deaf3c9f1017b01"), Common::ES_ESP, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // from VooD
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "747861d2a9c643c59fdab570df5b9093"), Common::ES_ESP, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // floppy 1.8 from clemmy
+	{ { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "ef08c8c237ee1473fd52578303fc36df"), Common::IT_ITA, Common::kPlatformPC }, KYRA1_FLOPPY_FLAGS }, // from gourry
 
-	{ { "kyra1", 0, AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), EN_ANY, kPlatformFMTowns }, KYRA1_TOWNS_FLAGS },
+	{ { "kyra1", 0, AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), Common::EN_ANY, Common::kPlatformFMTowns }, KYRA1_TOWNS_FLAGS },
 
-	{ { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "fac399fe62f98671e56a005c5e94e39f"), EN_ANY, kPlatformPC }, KYRA1_CD_FLAGS },
-	{ { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "230f54e6afc007ab4117159181a1c722"), DE_DEU, kPlatformPC }, KYRA1_CD_FLAGS },
-	{ { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "b037c41768b652a040360ffa3556fd2a"), FR_FRA, kPlatformPC }, KYRA1_CD_FLAGS },
+	{ { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "fac399fe62f98671e56a005c5e94e39f"), Common::EN_ANY, Common::kPlatformPC }, KYRA1_CD_FLAGS },
+	{ { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "230f54e6afc007ab4117159181a1c722"), Common::DE_DEU, Common::kPlatformPC }, KYRA1_CD_FLAGS },
+	{ { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "b037c41768b652a040360ffa3556fd2a"), Common::FR_FRA, Common::kPlatformPC }, KYRA1_CD_FLAGS },
 
-	{ { "kyra1", "Demo", AD_ENTRY1("DEMO1.WSA", "fb722947d94897512b13b50cc84fd648"), EN_ANY, kPlatformPC }, KYRA1_DEMO_FLAGS },
+	{ { "kyra1", "Demo", AD_ENTRY1("DEMO1.WSA", "fb722947d94897512b13b50cc84fd648"), Common::EN_ANY, Common::kPlatformPC }, KYRA1_DEMO_FLAGS },
 
-	{ { "kyra2", 0, AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), UNK_LANG, kPlatformPC }, KYRA2_UNK_FLAGS }, // check this! (cd version?)
+	{ { "kyra2", 0, AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), Common::UNK_LANG, Common::kPlatformPC }, KYRA2_UNK_FLAGS }, // check this! (cd version?)
 
-	{ { "kyra3", 0, AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), UNK_LANG, kPlatformPC }, KYRA3_CD_FLAGS },
-	{ { NULL, NULL, {NULL, 0, NULL, 0}, UNK_LANG, kPlatformUnknown }, FLAGS(0, 0, 0, 0, 0) }
+	{ { "kyra3", 0, AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), Common::UNK_LANG, Common::kPlatformPC }, KYRA3_CD_FLAGS },
+	{ { NULL, NULL, {NULL, 0, NULL, 0}, Common::UNK_LANG, Common::kPlatformUnknown }, FLAGS(0, 0, 0, 0, 0) }
 };
 
 const PlainGameDescriptor gameList[] = {
@@ -101,48 +98,48 @@
 }
 
 GameDescriptor Engine_KYRA_findGameID(const char *gameid) {
-	return ADVANCED_DETECTOR_FIND_GAMEID(gameid, detectionParams);
+	return Common::AdvancedDetector::findGameID(gameid, detectionParams);
 }
 
 GameList Engine_KYRA_detectGames(const FSList &fslist) {
-	return ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
+	return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
 }
 
 PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
 	assert(engine);
 	const char *gameid = ConfMan.get("gameid").c_str();
 	
-	int id = ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+	int id = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
 	if (id == -1) {
 		// FIXME: This case currently can never happen, as we simply error out
-		// inside ADVANCED_DETECTOR_DETECT_INIT_GAME.
+		// inside AdvancedDetector::detectBestMatchingGame.
 		
 		// maybe add non md5 based detection again?
 		return kNoGameDataFoundError;
 	}
 
-	GameFlags flags = adGameDescs[id].flags;
+	Kyra::GameFlags flags = adGameDescs[id].flags;
 
-	Platform platform = parsePlatform(ConfMan.get("platform"));
-	if (platform != kPlatformUnknown) {
+	Common::Platform platform = Common::parsePlatform(ConfMan.get("platform"));
+	if (platform != Common::kPlatformUnknown) {
 		flags.platform = platform;
 	}
 
-	if (flags.lang == UNK_LANG) {
-		Language lang = parseLanguage(ConfMan.get("language"));
-		if (lang != UNK_LANG) {
+	if (flags.lang == Common::UNK_LANG) {
+		Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
+		if (lang != Common::UNK_LANG) {
 			flags.lang = lang;
 		} else {
-			flags.lang = EN_ANY;
+			flags.lang = Common::EN_ANY;
 		}
 	}
 
 	if (!scumm_stricmp("kyra1", gameid)) {
-		*engine = new KyraEngine_v1(syst, flags);
+		*engine = new Kyra::KyraEngine_v1(syst, flags);
 	} else if (!scumm_stricmp("kyra2", gameid)) {
-		*engine = new KyraEngine_v2(syst, flags);
+		*engine = new Kyra::KyraEngine_v2(syst, flags);
 	} else if (!scumm_stricmp("kyra3", gameid)) {
-		*engine = new KyraEngine_v3(syst, flags);
+		*engine = new Kyra::KyraEngine_v3(syst, flags);
 	} else
 		error("Kyra engine created with invalid gameid");
 

Modified: scummvm/trunk/engines/parallaction/detection.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/detection.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/engines/parallaction/detection.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -100,14 +100,14 @@
 namespace Parallaction {
 
 bool Parallaction::detectGame() {
-	int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+	int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
 
 	_gameDescription = &gameDescriptions[i];
 	return true;
 }
 
 GameList GAME_detectGames(const FSList &fslist) {
-	return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
+	return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
 }
 
 } // End of namespace Parallaction

Modified: scummvm/trunk/engines/saga/game.cpp
===================================================================
--- scummvm/trunk/engines/saga/game.cpp	2007-01-25 17:47:06 UTC (rev 25193)
+++ scummvm/trunk/engines/saga/game.cpp	2007-01-25 21:16:57 UTC (rev 25194)
@@ -114,7 +114,9 @@
 namespace Saga {
 
 bool SagaEngine::initGame() {
-	int i = Common::ADVANCED_DETECTOR_DETECT_INIT_GAME(detectionParams);
+	int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+	if (i < 0)
+		return false;
 
 	_gameDescription = &gameDescriptions[i];
 
@@ -126,7 +128,7 @@
 }
 
 GameList GAME_detectGames(const FSList &fslist) {
-	return Common::ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(fslist, detectionParams);
+	return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
 }
 
 } // End of namespace Saga


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