aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2007-02-13 13:04:51 +0000
committerMax Horn2007-02-13 13:04:51 +0000
commit287e21d36e047533fdf1b57cec5f123bdf75f8a6 (patch)
tree2970a1a2b7eb046a72b0cf30917750489176fbeb /common
parent55e132ca7da5f33b9b4c5405c2d85f1b413fd892 (diff)
downloadscummvm-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.cpp53
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 &params) {
}
}
-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)) {
- 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 &params
@@ -245,6 +218,32 @@ int detectBestMatchingGame(
return gameNumber;
}
+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)) {
+ 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 &params, Language language, Platform platform) {
typedef HashMap<String, bool, CaseSensitiveString_Hash, CaseSensitiveString_EqualTo> StringSet;