[Scummvm-cvs-logs] CVS: scummvm/base gameDetector.cpp,1.131,1.132 gameDetector.h,1.37,1.38 plugins.cpp,1.54,1.55
Max Horn
fingolfin at users.sourceforge.net
Sat Jan 21 05:03:01 CET 2006
Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20363/base
Modified Files:
gameDetector.cpp gameDetector.h plugins.cpp
Log Message:
Fix various incorrect usages of the word 'target' instead of 'gameid'; change the ambigiuous 'GameSettings::name' to 'GameSettings::gameid'
Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/gameDetector.cpp,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- gameDetector.cpp 18 Jan 2006 17:39:33 -0000 1.131
+++ gameDetector.cpp 21 Jan 2006 13:01:18 -0000 1.132
@@ -212,7 +212,7 @@
_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 @@
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 @@
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 @@
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 @@
// 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 @@
}
-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 @@
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 {
Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/gameDetector.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- gameDetector.h 18 Jan 2006 17:39:33 -0000 1.37
+++ gameDetector.h 21 Jan 2006 13:01:18 -0000 1.38
@@ -41,7 +41,7 @@
};
struct GameSettings {
- const char *name;
+ const char *gameid;
const char *description;
uint32 features;
};
Index: plugins.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/plugins.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- plugins.cpp 18 Jan 2006 17:39:33 -0000 1.54
+++ plugins.cpp 21 Jan 2006 13:01:18 -0000 1.55
@@ -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 @@
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 @@
}
_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;
More information about the Scummvm-git-logs
mailing list