From 287e21d36e047533fdf1b57cec5f123bdf75f8a6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 13 Feb 2007 13:04:51 +0000 Subject: Moved detectGameForEngineCreation next to detectBestMatchingGame (somebody should explain the difference between the two...) svn-id: r25542 --- common/advancedDetector.cpp | 53 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'common/advancedDetector.cpp') diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index 6d2b6365a1..cd46cfca1d 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -90,33 +90,6 @@ void upgradeTargetIfNecessary(const Common::ADParams ¶ms) { } } -PluginError detectGameForEngineCreation( - GameList (*detectFunc)(const FSList &fslist), - const Common::ADParams ¶ms - ) { - Common::String gameid = ConfMan.get("gameid"); - - FSList fslist; - FilesystemNode dir(ConfMan.get("path")); - if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) { - return kInvalidPathError; - } - - GameList detectedGames = detectFunc(fslist); - - // We have single ID set, so we have a game if there are hits - if (params.singleid != NULL && detectedGames.size()) - return kNoError; - - for (uint i = 0; i < detectedGames.size(); i++) { - if (detectedGames[i].gameid() == gameid) { - return kNoError; - } - } - - return kNoGameDataFoundError; -} - GameDescriptor findGameID( const char *gameid, const Common::ADParams ¶ms @@ -245,6 +218,32 @@ int detectBestMatchingGame( return gameNumber; } +PluginError detectGameForEngineCreation( + GameList (*detectFunc)(const FSList &fslist), + const Common::ADParams ¶ms + ) { + Common::String gameid = ConfMan.get("gameid"); + + FSList fslist; + FilesystemNode dir(ConfMan.get("path")); + if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) { + return kInvalidPathError; + } + + GameList detectedGames = detectFunc(fslist); + + // We have single ID set, so we have a game if there are hits + if (params.singleid != NULL && detectedGames.size()) + return kNoError; + + for (uint i = 0; i < detectedGames.size(); i++) { + if (detectedGames[i].gameid() == gameid) { + return kNoError; + } + } + + return kNoGameDataFoundError; +} static ADList detectGame(const FSList *fslist, const Common::ADParams ¶ms, Language language, Platform platform) { typedef HashMap StringSet; -- cgit v1.2.3