Small cleanup to reduce amount of game id checks.

svn-id: r10402
This commit is contained in:
Travis Howell 2003-09-25 04:32:28 +00:00
parent 07c3c2dac6
commit ab66db7cd0
2 changed files with 13 additions and 29 deletions

View File

@ -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;

View File

@ -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;