diff options
| -rw-r--r-- | common/gameDetector.cpp | 33 | ||||
| -rw-r--r-- | common/gameDetector.h | 1 | 
2 files changed, 34 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;  			} diff --git a/common/gameDetector.h b/common/gameDetector.h index cdfb77d8e3..0a58030c86 100644 --- a/common/gameDetector.h +++ b/common/gameDetector.h @@ -86,6 +86,7 @@ public:  	bool parseMusicDriver(const char *s);  	void updateconfig(); +	void list_games();  public:  	OSystem *createSystem(); | 
