Moved detectGameForEngineCreation next to detectBestMatchingGame (somebody should explain the difference between the two...)
svn-id: r25542
This commit is contained in:
parent
55e132ca7d
commit
287e21d36e
1 changed files with 26 additions and 27 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue