diff options
author | Max Horn | 2003-12-17 01:17:12 +0000 |
---|---|---|
committer | Max Horn | 2003-12-17 01:17:12 +0000 |
commit | b4f33afb8587ea1a53a7772cc95819f2f5b4e13d (patch) | |
tree | 7e4b309df1e0598bee64dd1560273aa1999a7842 | |
parent | 36cb1ed6b5e204ef72b8c134007b7bb1cb9cfb97 (diff) | |
download | scummvm-rg350-b4f33afb8587ea1a53a7772cc95819f2f5b4e13d.tar.gz scummvm-rg350-b4f33afb8587ea1a53a7772cc95819f2f5b4e13d.tar.bz2 scummvm-rg350-b4f33afb8587ea1a53a7772cc95819f2f5b4e13d.zip |
simplified game detection code etc.
svn-id: r11692
-rw-r--r-- | sword1/sword1.cpp | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp index b0f3134c1f..9fd61c4f74 100644 --- a/sword1/sword1.cpp +++ b/sword1/sword1.cpp @@ -40,50 +40,30 @@ #include "menu.h" #include "music.h" -// taken from Sword2.cpp -struct Sword1GameSettings { - const char *name; - const char *description; - uint32 features; - const char *detectname; - GameSettings toGameSettings() const { - GameSettings dummy = { name, description, features }; - return dummy; - } -}; - -static const Sword1GameSettings sword1_settings[] = { - /* Broken Sword 1 */ - {"sword1", "Broken Sword I", GF_DEFAULT_TO_1X_SCALER, "swordres.rif" }, - {NULL, NULL, 0, NULL} -}; +/* Broken Sword 1 */ +static const GameSettings sword1_setting = + {"sword1", "Broken Sword I", GF_DEFAULT_TO_1X_SCALER}; GameList Engine_SWORD1_gameList() { - const Sword1GameSettings *g = sword1_settings; GameList games; - while (g->name) { - games.push_back(g->toGameSettings()); - g++; - } + games.push_back(sword1_setting); return games; } GameList Engine_SWORD1_detectGames(const FSList &fslist) { GameList detectedGames; - const Sword1GameSettings *g; - for (g = sword1_settings; g->name; ++g) { - // 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(); + // 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(g->detectname, gameName)) { - // Match found, add to list of candidates, then abort inner loop. - detectedGames.push_back(g->toGameSettings()); - break; - } + if (0 == scumm_stricmp("swordres.rif", gameName)) { + // Match found, add to list of candidates, then abort inner loop. + detectedGames.push_back(sword1_setting); + break; } } + return detectedGames; } |