aboutsummaryrefslogtreecommitdiff
path: root/base/plugins.h
diff options
context:
space:
mode:
authorEugene Sandulenko2007-01-20 21:27:57 +0000
committerEugene Sandulenko2007-01-20 21:27:57 +0000
commitcd8a5f3a98287fe7366db100c2fb45ff986e2d1b (patch)
treec3acca9454ff39fc71da8444eb98494683a6261f /base/plugins.h
parent47b1321d1520eabcfa4d971bd945f4461eeada49 (diff)
downloadscummvm-rg350-cd8a5f3a98287fe7366db100c2fb45ff986e2d1b.tar.gz
scummvm-rg350-cd8a5f3a98287fe7366db100c2fb45ff986e2d1b.tar.bz2
scummvm-rg350-cd8a5f3a98287fe7366db100c2fb45ff986e2d1b.zip
First phase of detection-related plugins interface improvements. Now plugins
return StringMap instead of fixed list of parameters. This adds great flexibility. Current patch should not alter any functionality, i.e. if there are regressions, submit a report. Phase 2 will benefit from these changes and will come later. svn-id: r25134
Diffstat (limited to 'base/plugins.h')
-rw-r--r--base/plugins.h37
1 files changed, 4 insertions, 33 deletions
diff --git a/base/plugins.h b/base/plugins.h
index 9b14f52d57..9b20c6fbdd 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -36,35 +36,6 @@ class FSList;
class OSystem;
/**
- * A detected game. Carries the GameDescriptor, but also (optionally)
- * information about the language and platform of the detected game.
- */
-struct DetectedGame : public GameDescriptor {
- Common::Language language;
- Common::Platform platform;
- DetectedGame(const char *g = 0, const char *d = 0,
- Common::Language l = Common::UNK_LANG,
- Common::Platform p = Common::kPlatformUnknown)
- : GameDescriptor(g, d), language(l), platform(p) {}
-
- template <class T>
- DetectedGame(const T &game,
- Common::Language l = Common::UNK_LANG,
- Common::Platform p = Common::kPlatformUnknown)
- : GameDescriptor(game.gameid, game.description), language(l), platform(p) {}
-
- /**
- * Update the description string by appending (LANG/PLATFORM/EXTRA) to it.
- */
- void updateDesc(const char *extra = 0);
-};
-
-
-/** List of detected games. */
-typedef Common::Array<DetectedGame> DetectedGameList;
-
-
-/**
* Error codes which mayb be reported by plugins under various circumstances.
* @todo Turn this into a global 'ErrorCode' enum used by all of ScummVM ?
*/
@@ -96,7 +67,7 @@ public:
virtual GameList getSupportedGames() const = 0;
virtual GameDescriptor findGame(const char *gameid) const = 0;
- virtual DetectedGameList detectGames(const FSList &fslist) const = 0;
+ virtual GameList detectGames(const FSList &fslist) const = 0;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const = 0;
};
@@ -146,7 +117,7 @@ public:
PLUGIN_EXPORT GameList PLUGIN_gameIDList() { return Engine_##ID##_gameIDList(); } \
PLUGIN_EXPORT GameDescriptor PLUGIN_findGameID(const char *gameid) { return Engine_##ID##_findGameID(gameid); } \
PLUGIN_EXPORT PluginError PLUGIN_createEngine(OSystem *syst, Engine **engine) { return Engine_##ID##_create(syst, engine); } \
- PLUGIN_EXPORT DetectedGameList PLUGIN_detectGames(const FSList &fslist) { return Engine_##ID##_detectGames(fslist); } \
+ PLUGIN_EXPORT GameList PLUGIN_detectGames(const FSList &fslist) { return Engine_##ID##_detectGames(fslist); } \
} \
void dummyFuncToAllowTrailingSemicolon()
#endif
@@ -161,7 +132,7 @@ class PluginRegistrator {
public:
typedef GameDescriptor (*GameIDQueryFunc)(const char *gameid);
typedef PluginError (*EngineFactory)(OSystem *syst, Engine **engine);
- typedef DetectedGameList (*DetectFunc)(const FSList &fslist);
+ typedef GameList (*DetectFunc)(const FSList &fslist);
protected:
const char *_name;
@@ -225,7 +196,7 @@ public:
const PluginList &getPlugins() { return _plugins; }
- DetectedGameList detectGames(const FSList &fslist) const;
+ GameList detectGames(const FSList &fslist) const;
};
#endif