diff options
author | Jonathan Gray | 2002-10-18 07:08:45 +0000 |
---|---|---|
committer | Jonathan Gray | 2002-10-18 07:08:45 +0000 |
commit | 2425fc44bffb3d2a0255a06637cf456cb8ef2be1 (patch) | |
tree | 71a670834c7937feb89bdfdceeb9ec02fc7b3ab5 /common/gameDetector.cpp | |
parent | c84d12e8d230cecb6268367d2b1604da8288da83 (diff) | |
download | scummvm-rg350-2425fc44bffb3d2a0255a06637cf456cb8ef2be1.tar.gz scummvm-rg350-2425fc44bffb3d2a0255a06637cf456cb8ef2be1.tar.bz2 scummvm-rg350-2425fc44bffb3d2a0255a06637cf456cb8ef2be1.zip |
add -z option to list games
svn-id: r5182
Diffstat (limited to 'common/gameDetector.cpp')
-rw-r--r-- | common/gameDetector.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index d63605d105..78fab22134 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -68,6 +68,7 @@ static const char USAGE_STRING[] = #endif "\t-x[<num>] - save game slot to load (default: autosave)\n" "\t-y - set text speed (default: 60)\n" + "\t-z - display list of games\n" ; @@ -165,6 +166,34 @@ void GameDetector::updateconfig() _talkSpeed = g_config->getInt("talkspeed", _talkSpeed); } +void GameDetector::list_games() +{ + const VersionSettings *v = version_settings; + char config[4] = ""; + + printf("Game SCUMM ver Full Title Config\n" + "----------- ----------- ---------------------------------------------- -------\n"); + + while (v->filename && v->gamename) { + if (g_config->has_domain(v->filename)) { + strcpy(config, "Yes"); + } + else { + strcpy(config, ""); + } + + if (v->major != 99) + printf("%-12s%d.%d.%d\t%-47s%s\n", v->filename, + v->major, v->middle, v->minor, v->gamename, config); + else + printf("%-12s%-7s\t%-47s%s\n", v->filename, "n/a", + v->gamename, config); + + v++; + } + +} + void GameDetector::parseCommandLine(int argc, char **argv) { int i; @@ -288,6 +317,10 @@ void GameDetector::parseCommandLine(int argc, char **argv) _talkSpeed = atoi(option); g_config->setInt("talkspeed", _talkSpeed); break; + case 'z': + CHECK_OPTION(); + list_games(); + exit(1); default: goto ShowHelpAndExit; } |