aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2006-01-21 13:01:20 +0000
committerMax Horn2006-01-21 13:01:20 +0000
commit0b39c0ea9fbc43569a17f65db6fe6a89f29ccee1 (patch)
treec1b6170cbc006981a22b36c4b02f10bda699c542 /base
parente34d963027194654259c4ce3499780671f36e133 (diff)
downloadscummvm-rg350-0b39c0ea9fbc43569a17f65db6fe6a89f29ccee1.tar.gz
scummvm-rg350-0b39c0ea9fbc43569a17f65db6fe6a89f29ccee1.tar.bz2
scummvm-rg350-0b39c0ea9fbc43569a17f65db6fe6a89f29ccee1.zip
Fix various incorrect usages of the word 'target' instead of 'gameid'; change the ambigiuous 'GameSettings::name' to 'GameSettings::gameid'
svn-id: r20115
Diffstat (limited to 'base')
-rw-r--r--base/gameDetector.cpp22
-rw-r--r--base/gameDetector.h2
-rw-r--r--base/plugins.cpp8
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;