diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/gameDetector.cpp | 22 | ||||
-rw-r--r-- | base/gameDetector.h | 2 | ||||
-rw-r--r-- | base/plugins.cpp | 8 |
3 files changed, 18 insertions, 14 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 256fdcc12b..567baca03e 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -212,7 +212,7 @@ GameDetector::GameDetector() { _plugin = 0; } -/** List all supported games, i.e. all games which any loaded plugin supports. */ +/** List all supported game IDs, i.e. all games which any loaded plugin supports. */ void listGames() { const PluginList &plugins = PluginManager::instance().getPlugins(); @@ -223,7 +223,7 @@ void listGames() { for (iter = plugins.begin(); iter != plugins.end(); ++iter) { GameList list = (*iter)->getSupportedGames(); for (GameList::iterator v = list.begin(); v != list.end(); ++v) { - printf("%-20s %s\n", v->name, v->description); + printf("%-20s %s\n", v->gameid, v->description); } } } @@ -242,7 +242,11 @@ void listTargets() { String description(iter->_value.get("description")); if (description.isEmpty()) { - GameSettings g = GameDetector::findGame(name); + // FIXME: At this point, we should check for a "gameid" override + // to find the proper desc. In fact, the platform probably should + // be take into consideration, too. + String gameid(name); + GameSettings g = GameDetector::findGame(gameid); if (g.description) description = g.description; } @@ -259,7 +263,7 @@ GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugi PluginList::const_iterator iter = plugins.begin(); for (iter = plugins.begin(); iter != plugins.end(); ++iter) { result = (*iter)->findGame(gameName.c_str()); - if (result.name) { + if (result.gameid) { if (plugin) *plugin = *iter; break; @@ -364,7 +368,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) { // To verify this, check if there is either a game domain (i.e. // a configured target) matching this argument, or if we can // find any target with that name. - if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findGame(s).name)) { + if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findGame(s).gameid)) { setTarget(s); } else { if (current_option == NULL) @@ -596,9 +600,9 @@ ShowHelpAndExit: } -void GameDetector::setTarget(const String &name) { - _targetName = name; - ConfMan.setActiveDomain(name); +void GameDetector::setTarget(const String &target) { + _targetName = target; + ConfMan.setActiveDomain(target); } bool GameDetector::detectGame() { @@ -612,7 +616,7 @@ bool GameDetector::detectGame() { printf("Looking for %s\n", realGame.c_str()); _game = findGame(realGame, &_plugin); - if (_game.name) { + if (_game.gameid) { printf("Trying to start game '%s'\n", _game.description); return true; } else { diff --git a/base/gameDetector.h b/base/gameDetector.h index d60b25b017..fefaf4139c 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -41,7 +41,7 @@ enum { }; struct GameSettings { - const char *name; + const char *gameid; const char *description; uint32 features; }; diff --git a/base/plugins.cpp b/base/plugins.cpp index 427529851f..0589ac6b7f 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -31,7 +31,7 @@ typedef Engine *(*EngineFactory)(GameDetector *detector, OSystem *syst); typedef const char *(*NameFunc)(); -typedef GameList (*TargetListFunc)(); +typedef GameList (*GameIDListFunc)(); typedef DetectedGameList (*DetectFunc)(const FSList &fslist); @@ -75,7 +75,7 @@ GameSettings Plugin::findGame(const char *gameName) const { GameList games = getSupportedGames(); GameSettings result = {NULL, NULL, 0}; for (GameList::iterator g = games.begin(); g != games.end(); ++g) { - if (!scumm_stricmp(g->name, gameName)) { + if (!scumm_stricmp(g->gameid, gameName)) { result = *g; break; } @@ -194,8 +194,8 @@ bool DynamicPlugin::loadPlugin() { } _name = nameFunc(); - // Query the plugin for the targets it supports - TargetListFunc gameListFunc = (TargetListFunc)findSymbol("PLUGIN_getSupportedGames"); + // Query the plugin for the game ids it supports + GameIDListFunc gameListFunc = (GameIDListFunc)findSymbol("PLUGIN_getSupportedGames"); if (!gameListFunc) { unloadPlugin(); return false; |