aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-11-01 16:39:26 +0000
committerMax Horn2003-11-01 16:39:26 +0000
commit078091e7f4f67293a414979daf2062f5edfc393c (patch)
tree7d210b0aad9e94d2cbe61bfa10ae8dfda54dd169
parent7fc1e3ec92c864d30f3408de38d33ce6d0d54b67 (diff)
downloadscummvm-rg350-078091e7f4f67293a414979daf2062f5edfc393c.tar.gz
scummvm-rg350-078091e7f4f67293a414979daf2062f5edfc393c.tar.bz2
scummvm-rg350-078091e7f4f67293a414979daf2062f5edfc393c.zip
cleanup of game detector functions
svn-id: r11024
-rw-r--r--sky/sky.cpp13
-rw-r--r--sword2/sword2.cpp13
2 files changed, 9 insertions, 17 deletions
diff --git a/sky/sky.cpp b/sky/sky.cpp
index 22c170673e..781e91b39e 100644
--- a/sky/sky.cpp
+++ b/sky/sky.cpp
@@ -78,17 +78,12 @@ extern bool draw_keyboard;
#undef WITH_DEBUG_CHEATS
-static const GameSettings sky_settings[] = {
- /* Beneath a Steel Sky */
- {"sky", "Beneath a Steel Sky", MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "sky.dsk" },
- {NULL, NULL, MDT_NONE, 0, NULL}
-};
+static const GameSettings skySetting =
+ {"sky", "Beneath a Steel Sky", MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "sky.dsk" };
GameList Engine_SKY_gameList() {
- const GameSettings *g = sky_settings;
GameList games;
- while (g->gameName)
- games.push_back(*g++);
+ games.push_back(skySetting);
return games;
}
@@ -100,7 +95,7 @@ GameList Engine_SKY_detectGames(const FSList &fslist) {
if (0 == scumm_stricmp("sky.dsk", fileName)) {
// Match found, add to list of candidates, then abort inner loop.
- detectedGames.push_back(sky_settings[0]);
+ detectedGames.push_back(skySetting);
break;
}
}
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index c4d35f8b87..ec3e4c9202 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -74,20 +74,17 @@ GameList Engine_SWORD2_gameList() {
GameList Engine_SWORD2_detectGames(const FSList &fslist) {
GameList detectedGames;
const GameSettings *g;
- char detectName[128];
- char detectName2[128];
+
+ // TODO: It would be nice if we had code here which distinguishes between
+ // the 'sword2' and Ôsword2demoÔ targets. The current code can't do that
+ // since they use the same detectname.
for (g = sword2_settings; g->gameName; ++g) {
- strcpy(detectName, g->detectname);
- strcpy(detectName2, g->detectname);
- strcat(detectName2, ".");
-
// Iterate over all files in the given directory
for (FSList::ConstIterator file = fslist.begin(); file != fslist.end(); ++file) {
const char *gameName = file->displayName().c_str();
- if ((0 == scumm_stricmp(detectName, gameName)) ||
- (0 == scumm_stricmp(detectName2, gameName))) {
+ if (0 == scumm_stricmp(g->detectname, gameName)) {
// Match found, add to list of candidates, then abort inner loop.
detectedGames.push_back(*g);
break;