aboutsummaryrefslogtreecommitdiff
path: root/base/plugins.cpp
diff options
context:
space:
mode:
authorMax Horn2003-12-21 15:29:52 +0000
committerMax Horn2003-12-21 15:29:52 +0000
commitf19f73eb5069b4f092714535e77efc0d6881c612 (patch)
treeee5e418571bb6ebdb8bb6b8e72cb926ef31f2bd7 /base/plugins.cpp
parent7b498fe7db91fa3e52d2c69bc9980f4609acc288 (diff)
downloadscummvm-rg350-f19f73eb5069b4f092714535e77efc0d6881c612.tar.gz
scummvm-rg350-f19f73eb5069b4f092714535e77efc0d6881c612.tar.bz2
scummvm-rg350-f19f73eb5069b4f092714535e77efc0d6881c612.zip
Make it possible for game detection functions to detect language/platform (not yet done by any detector, but will come with the MD5 detection code)
svn-id: r11811
Diffstat (limited to 'base/plugins.cpp')
-rw-r--r--base/plugins.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 9769293a70..7968eb8e00 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -32,7 +32,7 @@ typedef Engine *(*EngineFactory)(GameDetector *detector, OSystem *syst);
typedef const char *(*NameFunc)();
typedef GameList (*TargetListFunc)();
-typedef GameList (*DetectFunc)(const FSList &fslist);
+typedef DetectedGameList (*DetectFunc)(const FSList &fslist);
#ifdef DYNAMIC_MODULES
@@ -81,7 +81,7 @@ public:
}
GameList getSupportedGames() const { return _games; }
- GameList detectGames(const FSList &fslist) const {
+ DetectedGameList detectGames(const FSList &fslist) const {
return (*_df)(fslist);
}
};
@@ -113,7 +113,7 @@ public:
}
GameList getSupportedGames() const { return _games; }
- GameList detectGames(const FSList &fslist) const {
+ DetectedGameList detectGames(const FSList &fslist) const {
assert(_df);
return (*_df)(fslist);
}
@@ -275,3 +275,16 @@ bool PluginManager::tryLoadPlugin(Plugin *plugin) {
return false;
}
}
+
+DetectedGameList PluginManager::detectGames(const FSList &fslist) const {
+ DetectedGameList candidates;
+
+ // Iterate over all known games and for each check if it might be
+ // the game in the presented directory.
+ PluginList::ConstIterator iter;
+ for (iter = _plugins.begin(); iter != _plugins.end(); ++iter) {
+ candidates.push_back((*iter)->detectGames(fslist));
+ }
+
+ return candidates;
+}