diff options
author | Max Horn | 2006-12-20 00:08:51 +0000 |
---|---|---|
committer | Max Horn | 2006-12-20 00:08:51 +0000 |
commit | 6eef02245cb5cf59d89eef8e020ae90b98109483 (patch) | |
tree | dcbda2a08463a6cfa0ee1978c09043dbb900692e | |
parent | dc30c2304c808dd25920e5f9a179533eb7a45555 (diff) | |
download | scummvm-rg350-6eef02245cb5cf59d89eef8e020ae90b98109483.tar.gz scummvm-rg350-6eef02245cb5cf59d89eef8e020ae90b98109483.tar.bz2 scummvm-rg350-6eef02245cb5cf59d89eef8e020ae90b98109483.zip |
Stripped some more real_ prefixes from function names; also added a new FIXME comment to Kyra's setupGameFlags, and did some more cleanup
svn-id: r24899
-rw-r--r-- | common/advancedDetector.cpp | 6 | ||||
-rw-r--r-- | common/advancedDetector.h | 8 | ||||
-rw-r--r-- | engines/kyra/plugin.cpp | 34 |
3 files changed, 23 insertions, 25 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index afa97935d6..81994f1378 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -33,7 +33,7 @@ namespace Common { -PluginError real_ADVANCED_DETECTOR_ENGINE_CREATE( +PluginError ADVANCED_DETECTOR_ENGINE_CREATE( DetectedGameList (*detectFunc)(const FSList &fslist), const Common::ADObsoleteGameID *obsoleteList ) { @@ -72,7 +72,7 @@ PluginError real_ADVANCED_DETECTOR_ENGINE_CREATE( return kNoGameDataFoundError; } -GameDescriptor real_ADVANCED_DETECTOR_FIND_GAMEID( +GameDescriptor ADVANCED_DETECTOR_FIND_GAMEID( const char *gameid, const PlainGameDescriptor *list, const Common::ADObsoleteGameID *obsoleteList @@ -174,7 +174,7 @@ int ADVANCED_DETECTOR_DETECT_INIT_GAME( matches = ad.detectGame(0, md5Bytes, language, platform); for (uint i = 0; i < matches.size(); i++) { - if (toDetectedGame(*(const ADGameDescription *)(descs + matches[i] * descItemSize), list).gameid == gameid) { + if (((const ADGameDescription *)(descs + matches[i] * descItemSize))->gameid == gameid) { gameNumber = matches[i]; break; } diff --git a/common/advancedDetector.h b/common/advancedDetector.h index 741a4cf009..098aa1bec9 100644 --- a/common/advancedDetector.h +++ b/common/advancedDetector.h @@ -92,7 +92,7 @@ private: // FIXME/TODO: Rename this function to something more sensible. // Possibly move it inside class AdvancedDetector ? -GameDescriptor real_ADVANCED_DETECTOR_FIND_GAMEID( +GameDescriptor ADVANCED_DETECTOR_FIND_GAMEID( const char *gameid, const PlainGameDescriptor *list, const Common::ADObsoleteGameID *obsoleteList @@ -121,7 +121,7 @@ int ADVANCED_DETECTOR_DETECT_INIT_GAME( // FIXME/TODO: Rename this function to something more sensible. // Possibly move it inside class AdvancedDetector ? -PluginError real_ADVANCED_DETECTOR_ENGINE_CREATE( +PluginError ADVANCED_DETECTOR_ENGINE_CREATE( DetectedGameList (*detectFunc)(const FSList &fslist), const Common::ADObsoleteGameID *obsoleteList ); @@ -132,7 +132,7 @@ PluginError real_ADVANCED_DETECTOR_ENGINE_CREATE( return GameList(list); \ } \ GameDescriptor Engine_##engine##_findGameID(const char *gameid) { \ - return Common::real_ADVANCED_DETECTOR_FIND_GAMEID(gameid,list,obsoleteList); \ + return Common::ADVANCED_DETECTOR_FIND_GAMEID(gameid,list,obsoleteList); \ } \ DetectedGameList Engine_##engine##_detectGames(const FSList &fslist) { \ return detectFunc(fslist); \ @@ -140,7 +140,7 @@ PluginError real_ADVANCED_DETECTOR_ENGINE_CREATE( PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \ assert(syst); \ assert(engine); \ - PluginError err = real_ADVANCED_DETECTOR_ENGINE_CREATE(detectFunc, obsoleteList); \ + PluginError err = ADVANCED_DETECTOR_ENGINE_CREATE(detectFunc, obsoleteList); \ if (err == kNoError) \ *engine = new createFunction(syst); \ return err; \ diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp index f033f3e800..52d3722905 100644 --- a/engines/kyra/plugin.cpp +++ b/engines/kyra/plugin.cpp @@ -150,21 +150,6 @@ static const KYRAGameDescription adGameDescs[] = { { { NULL, NULL, NULL, UNK_LANG, kPlatformUnknown }, KYRA2_UNK_FLAGS } }; -static ADList detectKyraGames(const FSList &fslist) { - Common::AdvancedDetector ad; - Common::ADList matches; - Common::ADGameDescList descList; - - for (int i = 0; i < ARRAYSIZE(adGameDescs) - 1; ++i) { - descList.push_back(&adGameDescs[i].desc); - } - - ad.registerGameDescriptions(descList); - - matches = ad.detectGame(&fslist, kMD5FileSizeLimit, Common::UNK_LANG, Common::kPlatformUnknown); - return matches; -} - static bool setupGameFlags(const ADList &list, GameFlags &flags) { if (!list.size()) { // maybe add non md5 based detection again? @@ -173,6 +158,8 @@ static bool setupGameFlags(const ADList &list, GameFlags &flags) { int id = list[0]; + // FIXME: Isn't the following check/loop obsolete (i.e. I was/am under the + // impression that AdvancedDetector already performs this check). if (list.size() > 1) { int filesCount = 0; int curID = 0; @@ -222,7 +209,7 @@ GameList Engine_KYRA_gameIDList() { } GameDescriptor Engine_KYRA_findGameID(const char *gameid) { - return Common::real_ADVANCED_DETECTOR_FIND_GAMEID(gameid, gameList, 0); + return Common::ADVANCED_DETECTOR_FIND_GAMEID(gameid, gameList, 0); } DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) { @@ -246,8 +233,19 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) { } GameFlags flags; - ADList games = detectKyraGames(fslist); - if (!setupGameFlags(games, flags)) { + Common::AdvancedDetector ad; + Common::ADList matches; + Common::ADGameDescList descList; + + for (int i = 0; i < ARRAYSIZE(adGameDescs) - 1; ++i) { + descList.push_back(&adGameDescs[i].desc); + } + + ad.registerGameDescriptions(descList); + + matches = ad.detectGame(&fslist, kMD5FileSizeLimit, Common::UNK_LANG, Common::kPlatformUnknown); + + if (!setupGameFlags(matches, flags)) { return kNoGameDataFoundError; } |