diff options
| author | Travis Howell | 2003-09-25 04:32:28 +0000 | 
|---|---|---|
| committer | Travis Howell | 2003-09-25 04:32:28 +0000 | 
| commit | ab66db7cd0d87b9dec35420ad8284c88225be5c0 (patch) | |
| tree | 5cab50ac0694bb84b3d847d32cb4ad6238e645f9 | |
| parent | 07c3c2dac65f48ae61e51cb37588b28c0408884b (diff) | |
| download | scummvm-rg350-ab66db7cd0d87b9dec35420ad8284c88225be5c0.tar.gz scummvm-rg350-ab66db7cd0d87b9dec35420ad8284c88225be5c0.tar.bz2 scummvm-rg350-ab66db7cd0d87b9dec35420ad8284c88225be5c0.zip | |
Small cleanup to reduce amount of game id checks.
svn-id: r10402
| -rw-r--r-- | simon/res.cpp | 27 | ||||
| -rw-r--r-- | simon/simon.cpp | 15 | 
2 files changed, 13 insertions, 29 deletions
| diff --git a/simon/res.cpp b/simon/res.cpp index 2a9de5dd83..cd8183f53a 100644 --- a/simon/res.cpp +++ b/simon/res.cpp @@ -258,29 +258,14 @@ byte *SimonEngine::readSingleOpcode(File *in, byte *ptr) {  	const char *const *table; -	switch (_game) { -	case GAME_SIMON1TALKIE: -	case GAME_SIMON1WIN: -	case GAME_SIMON1CD32: -	case GAME_SIMON1ACORN: -		table = opcode_arg_table_simon1win; -		break; -	case GAME_SIMON2DOS: -		table = opcode_arg_table_simon2dos; -		break; -	case GAME_SIMON2TALKIE: -	case GAME_SIMON2WIN: -	case GAME_SIMON2MAC: +	if ((_game & GF_SIMON2) && (_game & GF_TALKIE))  		table = opcode_arg_table_simon2win; -		break; -	case GAME_SIMON1DOS: -	case GAME_SIMON1DEMO: -	case GAME_SIMON1AMIGA: +	else if (_game & GF_SIMON2) +		table = opcode_arg_table_simon2dos; +	else if (_game & GF_TALKIE) +		table = opcode_arg_table_simon1win; +	else  		table = opcode_arg_table_simon1dos; -		break; -	default: -		error("Invalid game specified"); -	}  	i = 0; diff --git a/simon/simon.cpp b/simon/simon.cpp index 0f4c09e36e..fce3ee104b 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -210,21 +210,20 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)  	_game = (byte)detector->_game.features; -	if (_game == GAME_SIMON2MAC) { +	if (_game & GF_MAC)  		gss = &simon2mac_settings; -	} else if (_game == GAME_SIMON2TALKIE || _game == GAME_SIMON2WIN) { +	else if ((_game & GF_SIMON2) && (_game & GF_TALKIE))  		gss = &simon2win_settings; -	} else if (_game == GAME_SIMON2DOS) { +	else if (_game & GF_SIMON2)  		gss = &simon2dos_settings; -	} else if (_game == GAME_SIMON1ACORN) { +	else if (_game & GF_ACORN)  		gss =&simon1acorn_settings; -	} else if (_game & GF_AMIGA) { +	else if (_game & GF_AMIGA)  		gss = &simon1amiga_settings; -	} else if (_game == GAME_SIMON1DEMO) { +	else if (_game & GF_DEMO)  		gss = &simon1demo_settings; -	} else { +	else  		gss = &simon1_settings; -	}  	_key_pressed = 0; | 
