diff options
author | Max Horn | 2007-02-13 13:04:51 +0000 |
---|---|---|
committer | Max Horn | 2007-02-13 13:04:51 +0000 |
commit | 287e21d36e047533fdf1b57cec5f123bdf75f8a6 (patch) | |
tree | 2970a1a2b7eb046a72b0cf30917750489176fbeb /common | |
parent | 55e132ca7da5f33b9b4c5405c2d85f1b413fd892 (diff) | |
download | scummvm-rg350-287e21d36e047533fdf1b57cec5f123bdf75f8a6.tar.gz scummvm-rg350-287e21d36e047533fdf1b57cec5f123bdf75f8a6.tar.bz2 scummvm-rg350-287e21d36e047533fdf1b57cec5f123bdf75f8a6.zip |
Moved detectGameForEngineCreation next to detectBestMatchingGame (somebody should explain the difference between the two...)
svn-id: r25542
Diffstat (limited to 'common')
-rw-r--r-- | common/advancedDetector.cpp | 53 |
1 files changed, 26 insertions, 27 deletions
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<String, bool, CaseSensitiveString_Hash, CaseSensitiveString_EqualTo> StringSet; |