diff options
-rw-r--r-- | base/gameDetector.cpp | 2 | ||||
-rw-r--r-- | base/plugins.cpp | 16 | ||||
-rw-r--r-- | base/plugins.h | 6 | ||||
-rw-r--r-- | gui/launcher.cpp | 4 |
4 files changed, 15 insertions, 13 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 3e821880b2..9c8dd4d8e2 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -247,7 +247,7 @@ void GameDetector::list_games() { PluginList::ConstIterator iter = plugins.begin(); for (iter = plugins.begin(); iter != plugins.end(); ++iter) { - v = (*iter)->getTargets(); + v = (*iter)->getSupportedGames(); while (v->gameName && v->description) { #if 1 printf("%-17s%-56s\n", v->gameName, v->description); diff --git a/base/plugins.cpp b/base/plugins.cpp index 9d78f2ffa2..518b588a69 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -74,8 +74,8 @@ extern Engine *Engine_QUEEN_create(GameDetector *detector, OSystem *syst); #pragma mark - -int Plugin::countTargets() const { - const GameSettings *target = getTargets(); +int Plugin::countSupportedGames() const { + const GameSettings *target = getSupportedGames(); int count; for (count = 0; target->gameName; target++, count++) ; @@ -84,7 +84,7 @@ int Plugin::countTargets() const { const GameSettings *Plugin::findGame(const char *gameName) const { // Find the GameSettings for this target - const GameSettings *target = getTargets(); + const GameSettings *target = getSupportedGames(); assert(gameName); while (target->gameName) { if (!scumm_stricmp(target->gameName, gameName)) { @@ -107,13 +107,13 @@ class StaticPlugin : public Plugin { public: StaticPlugin(const char *name, const GameSettings *targets, EngineFactory ef) : _name(name), _targets(targets), _ef(ef) { - _targetCount = Plugin::countTargets(); + _targetCount = Plugin::countSupportedGames(); } const char *getName() const { return _name; } - int countTargets() const { return _targetCount; } - const GameSettings *getTargets() const { return _targets; } + int countSupportedGames() const { return _targetCount; } + const GameSettings *getSupportedGames() const { return _targets; } Engine *createInstance(GameDetector *detector, OSystem *syst) const { return (*_ef)(detector, syst); @@ -143,8 +143,8 @@ public: const char *getName() const { return _name.c_str(); } - int countTargets() const { return _targetCount; } - const GameSettings *getTargets() const { return _targets; } + int countSupportedGames() const { return _targetCount; } + const GameSettings *getSupportedGames() const { return _targets; } Engine *createInstance(GameDetector *detector, OSystem *syst) const { assert(_ef); diff --git a/base/plugins.h b/base/plugins.h index 817ec79f85..77b5e90708 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -36,6 +36,7 @@ struct GameSettings; * Subclasses for this can be used to wrap both static and dynamic * plugins. */ +//typedef Common::List<GameSettings> GameList; class Plugin { public: virtual ~Plugin() {} @@ -46,9 +47,10 @@ public: virtual const char *getName() const = 0; virtual int getVersion() const { return 0; } // TODO! - virtual int countTargets() const; - virtual const GameSettings *getTargets() const = 0; + virtual int countSupportedGames() const; + virtual const GameSettings *getSupportedGames() const = 0; virtual const GameSettings *findGame(const char *gameName) const; + //virtual GameList detectGames(const FSList &fslist) const; virtual Engine *createInstance(GameDetector *detector, OSystem *syst) const = 0; }; diff --git a/gui/launcher.cpp b/gui/launcher.cpp index a3a4d62ca7..322a7fd839 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -98,7 +98,7 @@ EditGameDialog::EditGameDialog(NewGui *gui, const String &domain, const GameSett // Determine the description string String description(ConfMan.get("description", domain)); - if (description.isEmpty()) { + if (description.isEmpty() && target) { description = target->description; } @@ -284,7 +284,7 @@ GameList findGame(FilesystemNode *dir) { const PluginList &plugins = PluginManager::instance().getPlugins(); int p; for (p = 0; p < plugins.size(); p++) { - const GameSettings *v = plugins[p]->getTargets(); + const GameSettings *v = plugins[p]->getSupportedGames(); while (v->gameName && v->description) { // Determine the 'detectname' for this game, that is, the name of a |