[Scummvm-cvs-logs] CVS: scummvm/simon res.cpp,1.25,1.26 simon.cpp,1.300,1.301

Travis Howell kirben at users.sourceforge.net
Wed Sep 24 21:33:03 CEST 2003


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv16262/simon

Modified Files:
	res.cpp simon.cpp 
Log Message:

Small cleanup to reduce amount of game id checks.



Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- res.cpp	24 Sep 2003 06:31:42 -0000	1.25
+++ res.cpp	25 Sep 2003 04:32:27 -0000	1.26
@@ -258,29 +258,14 @@
 
 	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;
 

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.300
retrieving revision 1.301
diff -u -d -r1.300 -r1.301
--- simon.cpp	25 Sep 2003 04:23:07 -0000	1.300
+++ simon.cpp	25 Sep 2003 04:32:28 -0000	1.301
@@ -210,21 +210,20 @@
 	
 	_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;
 





More information about the Scummvm-git-logs mailing list