aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2003-09-25 04:32:28 +0000
committerTravis Howell2003-09-25 04:32:28 +0000
commitab66db7cd0d87b9dec35420ad8284c88225be5c0 (patch)
tree5cab50ac0694bb84b3d847d32cb4ad6238e645f9 /simon
parent07c3c2dac65f48ae61e51cb37588b28c0408884b (diff)
downloadscummvm-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
Diffstat (limited to 'simon')
-rw-r--r--simon/res.cpp27
-rw-r--r--simon/simon.cpp15
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;