[Scummvm-cvs-logs] CVS: scummvm/scumm scummvm.cpp,2.373,2.374 script.cpp,1.128,1.129

Max Horn fingolfin at users.sourceforge.net
Sat Sep 6 16:31:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv17044/scumm

Modified Files:
	scummvm.cpp script.cpp 
Log Message:
implemented FOA keyboard fighting

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.373
retrieving revision 2.374
diff -u -d -r2.373 -r2.374
--- scummvm.cpp	6 Sep 2003 01:44:29 -0000	2.373
+++ scummvm.cpp	6 Sep 2003 23:29:35 -0000	2.374
@@ -1497,7 +1497,7 @@
 				sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot);
 				_saveLoadFlag = (event.kbd.flags == OSystem::KBD_ALT) ? 1 : 2;
 				_saveLoadCompatible = false;
-			} else if (event.kbd.flags==OSystem::KBD_CTRL) {
+			} else if (event.kbd.flags == OSystem::KBD_CTRL) {
 				if (event.kbd.keycode == 'f')
 					_fastMode ^= 1;
 				else if (event.kbd.keycode == 'g')
@@ -1513,16 +1513,27 @@
 				// because that's what MI2 looks for in
 				// its "instant win" cheat.
 				_keyPressed = event.kbd.keycode + 154;
-			// FIXME support in game screen
-			// this remaps F1 to F5 for comi
-			} else if (event.kbd.ascii == 315 && _gameId == GID_CMI)
+			} else if (event.kbd.ascii == 315 && _gameId == GID_CMI) {
+				// FIXME: support in-game menu screen. For now, this remaps F1 to F5 in COMI
 				_keyPressed = 319;
-			// don't let game have arrow keys as we currently steal them
-			// for keyboard cursor control
-			// this fixes bug with up arrow (273) corresponding to
-			// "instant win" cheat in MI2 mentioned above
-			else if (event.kbd.ascii < 273 || event.kbd.ascii > 276)
+			} else if (_gameId == GID_INDY4 && event.kbd.ascii >= '0' && event.kbd.ascii <= '9') {
+				// To support keyboard fighting in FOA, we need to remap the number keys.
+				// FOA apparently expects PC scancode values (see script 46 if you want
+				// to know where I got these numbers from).
+				static const int numpad[10] = {
+						'0',
+						335, 336, 337,
+						331, 332, 333,
+						327, 328, 329
+					};
+				_keyPressed = numpad[event.kbd.ascii - '0'];
+			} else if (event.kbd.ascii < 273 || event.kbd.ascii > 276) {
+				// don't let game have arrow keys as we currently steal them
+				// for keyboard cursor control
+				// this fixes bug with up arrow (273) corresponding to
+				// "instant win" cheat in MI2 mentioned above
 				_keyPressed = event.kbd.ascii;	// Normal key press, pass on to the game.
+			}
 			break;
 
 		case OSystem::EVENT_MOUSEMOVE:

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- script.cpp	1 Sep 2003 03:08:32 -0000	1.128
+++ script.cpp	6 Sep 2003 23:29:35 -0000	1.129
@@ -573,11 +573,6 @@
 			var &= 0x7FFF;
 			checkRange(_numBitVariables - 1, 0, var, "Bit variable %d out of range(w)");
 	
-			// FIXME: Enable Indy4 mousefighting by default. 
-			// is there a better place to put this?
-			if (_gameId == GID_INDY4 && var == 107 && vm.slot[_currentScript].number == 1)
-				value = 1;
-	
 			if (value)
 				_bitVars[var >> 3] |= (1 << (var & 7));
 			else





More information about the Scummvm-git-logs mailing list