[Scummvm-cvs-logs] SF.net SVN: scummvm: [27655] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Jun 23 12:38:05 CEST 2007


Revision: 27655
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27655&view=rev
Author:   fingolfin
Date:     2007-06-23 03:38:03 -0700 (Sat, 23 Jun 2007)

Log Message:
-----------
Made SCUMM use Common::KeyState, too (but implemented almost no fixes/optimizations based on this)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/input.cpp
    scummvm/trunk/engines/scumm/intern.h
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h

Modified: scummvm/trunk/engines/scumm/input.cpp
===================================================================
--- scummvm/trunk/engines/scumm/input.cpp	2007-06-23 10:06:39 UTC (rev 27654)
+++ scummvm/trunk/engines/scumm/input.cpp	2007-06-23 10:38:03 UTC (rev 27655)
@@ -85,17 +85,21 @@
 				else if (event.kbd.keycode == 's')
 					_res->resourceStats();
 				else
-					_keyPressed = event.kbd.ascii;	// Normal key press, pass on to the game.
+					_keyPressed = event.kbd;	// Normal key press, pass on to the game.
 			} else if (event.kbd.flags & Common::KBD_ALT) {
 				// The result must be 273 for Alt-W
 				// because that's what MI2 looks for in
 				// its "instant win" cheat.
-				_keyPressed = event.kbd.keycode + 154;
-			} else if (event.kbd.ascii == Common::ASCII_F1 && (_game.id == GID_CMI && !(_game.features & GF_DEMO))) {
+				// FIXME: Handle this specific property inside processKeyboard ?
+				_keyPressed = event.kbd;
+				_keyPressed.ascii = event.kbd.keycode + 154;
+			} else if (event.kbd.ascii == Common::KEYCODE_F1 && (_game.id == GID_CMI && !(_game.features & GF_DEMO))) {
 				// FIXME: support in-game menu screen. For now, this remaps F1 to F5 in COMI
-				_keyPressed = Common::ASCII_F5;
-			} else if (event.kbd.ascii < Common::KEYCODE_UP || event.kbd.ascii > Common::KEYCODE_LEFT || _game.version >= 7) {
-// FIXME: Don't use ASCII value to detect arrow keys, rather, use keycode!
+				// FIXME: Handle this specific property inside processKeyboard ?
+				_keyPressed = Common::KeyState(Common::KEYCODE_F5, Common::ASCII_F5);
+			} else if (event.kbd.keycode < Common::KEYCODE_UP || event.kbd.keycode > Common::KEYCODE_LEFT || _game.version >= 7) {
+				// FIXME: Handle this specific property inside processKeyboard ?
+
 				// 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
@@ -103,12 +107,13 @@
 				//
 				// This is not applicable to Full Throttle as it processes keyboard
 				// cursor control by itself. Also it fixes derby scene
-				_keyPressed = event.kbd.ascii;	// Normal key press, pass on to the game.
+				_keyPressed = event.kbd;	// Normal key press, pass on to the game.
 			}
 
 			if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD) {
-				if (event.kbd.ascii >= Common::KEYCODE_UP && event.kbd.ascii <= Common::KEYCODE_LEFT) {
-					_keyPressed = event.kbd.ascii - Common::KEYCODE_UP + 54;
+				if (event.kbd.keycode >= Common::KEYCODE_UP && event.kbd.keycode <= Common::KEYCODE_LEFT) {
+					_keyPressed = event.kbd;
+					_keyPressed.ascii = event.kbd.ascii - Common::KEYCODE_UP + 54;
 				}
 			}
 
@@ -116,16 +121,16 @@
 				// Keyboard is controlled via variable
 				int _keyState = 0;
 
-				if (event.kbd.ascii == Common::KEYCODE_LEFT) // Left
+				if (event.kbd.keycode == Common::KEYCODE_LEFT) // Left
 					_keyState = 1;
 
-				if (event.kbd.ascii == Common::KEYCODE_RIGHT) // Right
+				if (event.kbd.keycode == Common::KEYCODE_RIGHT) // Right
 					_keyState |= 2;
 
-				if (event.kbd.ascii == Common::KEYCODE_UP) // Up
+				if (event.kbd.keycode == Common::KEYCODE_UP) // Up
 					_keyState |= 4;
 
-				if (event.kbd.ascii == Common::KEYCODE_DOWN) // Down
+				if (event.kbd.keycode == Common::KEYCODE_DOWN) // Down
 					_keyState |= 8;
 
 				if (event.kbd.flags == Common::KBD_SHIFT)
@@ -137,10 +142,10 @@
 				VAR(VAR_KEY_STATE) = _keyState;
 			}
 
-			if (_keyPressed >= 512)
-				debugC(DEBUG_GENERAL, "_keyPressed > 512 (%d)", _keyPressed);
+			if (_keyPressed.ascii >= 512)
+				debugC(DEBUG_GENERAL, "_keyPressed > 512 (%d)", _keyPressed.ascii);
 			else
-				_keyDownMap[_keyPressed] = true;
+				_keyDownMap[_keyPressed.ascii] = true;
 			break;
 
 		case Common::EVENT_KEYUP:
@@ -195,11 +200,11 @@
 		// checking the gameid. Values are taken from script-14.
 
 		case Common::EVENT_WHEELDOWN:
-			_keyPressed = 55;
+			_keyPressed = Common::KeyState(Common::KEYCODE_7, 55);	// '7'
 			break;
 
 		case Common::EVENT_WHEELUP:
-			_keyPressed = 54;
+			_keyPressed = Common::KeyState(Common::KEYCODE_6, 54);	// '6'
 			break;
 
 		case Common::EVENT_QUIT:
@@ -219,20 +224,20 @@
 void ScummEngine_v90he::clearClickedStatus() {
 	ScummEngine::clearClickedStatus();
 	if (_game.heversion >= 98) {
-		_logicHE->processKeyStroke(_keyPressed);
+		_logicHE->processKeyStroke(_keyPressed.ascii);
 	}
 }
 
 void ScummEngine_v90he::processInput() {
 	if (_game.heversion >= 98) {
-		_logicHE->processKeyStroke(_keyPressed);
+		_logicHE->processKeyStroke(_keyPressed.ascii);
 	}
 	ScummEngine::processInput();
 }
 #endif
 
 void ScummEngine::clearClickedStatus() {
-	_keyPressed = 0;
+	_keyPressed.reset();
 
 	_mouseAndKeyboardStat = 0;
 	_leftBtnPressed &= ~msClicked;
@@ -241,15 +246,16 @@
 
 void ScummEngine_v0::processInput() {
 	// F1 - F3
-	if (_keyPressed >= Common::ASCII_F1 && _keyPressed <= Common::ASCII_F3) {
-		switchActor(_keyPressed - Common::ASCII_F1);
+	if (_keyPressed.ascii >= Common::ASCII_F1 && _keyPressed.ascii <= Common::ASCII_F3) {
+		switchActor(_keyPressed.ascii - Common::ASCII_F1);
 	}
 
 	ScummEngine::processInput();
 }
+
 void ScummEngine::processInput() {
-	int lastKeyHit = _keyPressed;
-	_keyPressed = 0;
+	Common::KeyState lastKeyHit = _keyPressed;
+	_keyPressed.reset();
 
 	//
 	// Clip the mouse coordinates, and compute _virtualMouse.x (and clip it, too)
@@ -279,30 +285,36 @@
 	_mouseAndKeyboardStat = 0;
 
 	// Interpret 'return' as left click and 'tab' as right click
-	if (lastKeyHit && _cursor.state > 0) {
-		if (lastKeyHit == 9) {
+	if (lastKeyHit.keycode && _cursor.state > 0) {
+		if (lastKeyHit.keycode == Common::KEYCODE_TAB) {
 			_mouseAndKeyboardStat = MBS_RIGHT_CLICK;
-			lastKeyHit = 0;
-		} else if (lastKeyHit == 13) {
+			lastKeyHit.reset();
+		} else if (lastKeyHit.keycode == Common::KEYCODE_RETURN) {
 			_mouseAndKeyboardStat = MBS_LEFT_CLICK;
-			lastKeyHit = 0;
+			lastKeyHit.reset();
 		}
 	}
 
-	if (_leftBtnPressed & msClicked && _rightBtnPressed & msClicked && _game.version >= 4) {
+	if ((_leftBtnPressed & msClicked) && (_rightBtnPressed & msClicked) && _game.version >= 4) {
 		// Pressing both mouse buttons is treated as if you pressed
 		// the cutscene exit key (i.e. ESC in most games). That mimicks
 		// the behaviour of the original engine where pressing both
 		// mouse buttons also skips the current cutscene.
 		_mouseAndKeyboardStat = 0;
-		lastKeyHit = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
-	} else if (_rightBtnPressed & msClicked && (_game.version <= 3 && _game.id != GID_LOOM)) {
+		lastKeyHit.ascii = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
+		lastKeyHit.keycode = (Common::KeyCode)lastKeyHit.ascii;
+		lastKeyHit.flags = 0;
+		//FIXME: lastKeyHit.keycode = ???; proper value???
+	} else if ((_rightBtnPressed & msClicked) && (_game.version <= 3 && _game.id != GID_LOOM)) {
 		// Pressing right mouse button is treated as if you pressed
 		// the cutscene exit key (i.e. ESC in most games). That mimicks
 		// the behaviour of the original engine where pressing right
 		// mouse button also skips the current cutscene.
 		_mouseAndKeyboardStat = 0;
-		lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
+		lastKeyHit.ascii = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
+		lastKeyHit.keycode = (Common::KeyCode)lastKeyHit.ascii;
+		lastKeyHit.flags = 0;
+		//FIXME: lastKeyHit.keycode = ???; proper value???
 	} else if (_leftBtnPressed & msClicked) {
 		_mouseAndKeyboardStat = MBS_LEFT_CLICK;
 	} else if (_rightBtnPressed & msClicked) {
@@ -323,33 +335,36 @@
 	_rightBtnPressed &= ~msClicked;
 
 #ifdef _WIN32_WCE
-	if (lastKeyHit == KEY_ALL_SKIP) {
+	if (lastKeyHit.ascii == KEY_ALL_SKIP) {
 		// Skip talk
-		if (VAR_TALKSTOP_KEY != 0xFF && _talkDelay > 0)
-			lastKeyHit = (uint)VAR(VAR_TALKSTOP_KEY);
-		else
-		// Escape
-			lastKeyHit = 27;
+		if (VAR_TALKSTOP_KEY != 0xFF && _talkDelay > 0) {
+			lastKeyHit.ascii = (uint)VAR(VAR_TALKSTOP_KEY);
+			lastKeyHit.keycode = (Common::KeyCode)lastKeyHit.ascii;
+			lastKeyHit.flags = 0;
+			//FIXME: lastKeyHit.keycode = ???; proper value???
+		} else {
+			lastKeyHit = Common::KeySate(Common::KEYCODE_ESCAPE);
+		}
 	}
 #endif
 
-	if (!lastKeyHit)
+	if (!lastKeyHit.ascii)
 		return;
 	
 	processKeyboard(lastKeyHit);
 }
 
 #ifndef DISABLE_SCUMM_7_8
-void ScummEngine_v8::processKeyboard(int lastKeyHit) {
+void ScummEngine_v8::processKeyboard(Common::KeyState lastKeyHit) {
 	// Alt-F5 brings up the original save/load dialog
 
-	if (lastKeyHit == 440 && !(_game.features & GF_DEMO)) {
-		lastKeyHit = Common::ASCII_F1;
+	if (lastKeyHit.ascii == 440 && !(_game.features & GF_DEMO)) {
+		lastKeyHit = Common::KeyState(Common::KEYCODE_F1, Common::ASCII_F1);
 	}
 
 	// If a key script was specified (a V8 feature), and it's trigger
 	// key was pressed, run it.
-	if (_keyScriptNo && (_keyScriptKey == lastKeyHit)) {
+	if (_keyScriptNo && (_keyScriptKey == lastKeyHit.ascii)) {
 		runScript(_keyScriptNo, 0, 0, 0);
 		return;
 	}
@@ -358,18 +373,18 @@
 	ScummEngine_v7::processKeyboard(lastKeyHit);
 }
 
-void ScummEngine_v7::processKeyboard(int lastKeyHit) {
+void ScummEngine_v7::processKeyboard(Common::KeyState lastKeyHit) {
 
 	// COMI version string is hard coded in the engine, hence we don't
 	// invoke versionDialog here (it would only show nonsense).
 	// Dig/FT version strings are partly hard coded, too.
-	if (_game.version == 7 && lastKeyHit == VAR(VAR_VERSION_KEY)) {
+	if (_game.version == 7 && lastKeyHit.ascii == VAR(VAR_VERSION_KEY)) {
 		versionDialog();
 		return;
 	}
 
 #ifndef _WIN32_WCE
-	if (VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY)) {
+	if (VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit.ascii == VAR(VAR_CUTSCENEEXIT_KEY)) {
 		// Skip cutscene (or active SMUSH video).
 		if (_smushActive) {
 			if (_game.id == GID_FT)
@@ -380,14 +395,14 @@
 		if (!_smushActive || _smushVideoShouldFinish)
 			abortCutscene();
 
-		_mouseAndKeyboardStat = lastKeyHit;
+		_mouseAndKeyboardStat = lastKeyHit.ascii;
 		return;
 	}
 #else
 	// On WinCE we've also got one special for skipping cutscenes or dialog, whatever is appropriate
 	// Since _smushActive is not a member of the base case class ScummEngine::, we detect here if we're
 	// playing a cutscene and skip it; else we forward the keystroke through to ScummEngine::processInput.
-	if (lastKeyHit == KEY_ALL_SKIP || (VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY))) {
+	if (lastKeyHit.ascii == KEY_ALL_SKIP || (VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit.ascii == VAR(VAR_CUTSCENEEXIT_KEY))) {
 		int bail = 1;
 		if (_smushActive) {
 			if (_game.id == GID_FT) {
@@ -413,8 +428,9 @@
 }
 #endif
 
-void ScummEngine_v6::processKeyboard(int lastKeyHit) {
-	if (lastKeyHit == 20) {
+void ScummEngine_v6::processKeyboard(Common::KeyState lastKeyHit) {
+printf("lastKeyHit ascii %d, keycode %d, flags %d\n", lastKeyHit.ascii, lastKeyHit.keycode, lastKeyHit.flags);
+	if (lastKeyHit.ascii == 20) {
 		// FIXME: The 20 seems to indicate Ctrl-T. Of course this is a
 		// rather ugly way to detect it -- modifier + ascii code would
 		// be a *lot* cleaner...
@@ -447,17 +463,17 @@
 	ScummEngine::processKeyboard(lastKeyHit);
 }
 
-void ScummEngine_v2::processKeyboard(int lastKeyHit) {
-	if (lastKeyHit == ' ') {		// space
+void ScummEngine_v2::processKeyboard(Common::KeyState lastKeyHit) {
+	if (lastKeyHit.ascii == ' ') {		// space
 		pauseGame();
-	} else if (lastKeyHit == Common::ASCII_F5) {
+	} else if (lastKeyHit.ascii == Common::ASCII_F5) {
 		mainMenuDialog();
-	} else if (lastKeyHit == Common::ASCII_F8) {
+	} else if (lastKeyHit.ascii == Common::ASCII_F8) {
 		confirmRestartDialog();
 	} else {
 
-		if ((_game.version == 0 && lastKeyHit == 27) || 
-			(VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit == Common::ASCII_F1-1+VAR(VAR_CUTSCENEEXIT_KEY))) {
+		if ((_game.version == 0 && lastKeyHit.ascii == 27) || 
+			(VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit.ascii == Common::ASCII_F1-1+VAR(VAR_CUTSCENEEXIT_KEY))) {
 			abortCutscene();
 		} else {
 			// Fall back to default behavior
@@ -466,8 +482,9 @@
 
 		// Alt-F5 brings up the original save/load dialog
 
-		if (lastKeyHit == 440) {
-			lastKeyHit = Common::ASCII_F5;
+		// FIXME -- use keycode + flags instead
+		if (lastKeyHit.ascii == 440) {
+			lastKeyHit = Common::KeyState(Common::KEYCODE_F5, Common::ASCII_F5);
 		}
 	
 		// Store the input type. So far we can't distinguish
@@ -475,19 +492,19 @@
 		// 1) Verb	2) Scene	3) Inv.		4) Key
 		// 5) Sentence Bar
 	
-		if (VAR_KEYPRESS != 0xFF && lastKeyHit) {		// Key Input
-			if (Common::ASCII_F1 <= lastKeyHit && lastKeyHit <= Common::ASCII_F9) {
+		if (VAR_KEYPRESS != 0xFF && lastKeyHit.ascii) {		// Key Input
+			if (Common::ASCII_F1 <= lastKeyHit.ascii && lastKeyHit.ascii <= Common::ASCII_F9) {
 				// Convert F-Keys for V1/V2 games (they start at 1 instead of at ASCII_F1)
-				VAR(VAR_KEYPRESS) = lastKeyHit - Common::ASCII_F1 + 1;
+				VAR(VAR_KEYPRESS) = lastKeyHit.ascii - Common::ASCII_F1 + 1;
 			} else {
-				VAR(VAR_KEYPRESS) = lastKeyHit;
+				VAR(VAR_KEYPRESS) = lastKeyHit.ascii;
 			}
 		}
 	}
 }
 
-void ScummEngine_v3::processKeyboard(int lastKeyHit) {
-	if (_game.platform == Common::kPlatformFMTowns && lastKeyHit == Common::ASCII_F8) {
+void ScummEngine_v3::processKeyboard(Common::KeyState lastKeyHit) {
+	if (_game.platform == Common::kPlatformFMTowns && lastKeyHit.ascii == Common::ASCII_F8) {
 		confirmRestartDialog();
 	} else {
 		// Fall back to default behavior
@@ -496,7 +513,7 @@
 
 	// i brings up an IQ dialog in Indy3
 
-	if (lastKeyHit == 'i' && _game.id == GID_INDY3) {
+	if (lastKeyHit.ascii == 'i' && _game.id == GID_INDY3) {
 		// SCUMM var 244 is the episode score
 		// and var 245 is the series score
 		char text[50];
@@ -515,7 +532,7 @@
 	}
 }
 
-void ScummEngine::processKeyboard(int lastKeyHit) {
+void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 	int saveloadkey;
 
 	if ((_game.version <= 3) || (_game.id == GID_SAMNMAX) || (_game.id == GID_CMI) || (_game.heversion >= 72))
@@ -525,12 +542,14 @@
 
 	// Alt-F5 brings up the original save/load dialog.
 
-	if (lastKeyHit == 440 && _game.version > 2 && _game.version < 8) {
-		lastKeyHit = saveloadkey;
+	if (lastKeyHit.ascii == 440 && _game.version > 2 && _game.version < 8) {
+		// FIXME
+		lastKeyHit = Common::KeyState((Common::KeyCode)saveloadkey);
+		
 		saveloadkey = -1;
 	}
 
-	if (lastKeyHit == saveloadkey) {
+	if (lastKeyHit.ascii == saveloadkey) {
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0);
 
@@ -539,25 +558,25 @@
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, 0);
 
-	} else if (VAR_RESTART_KEY != 0xFF && lastKeyHit == VAR(VAR_RESTART_KEY)) {
+	} else if (VAR_RESTART_KEY != 0xFF && lastKeyHit.ascii == VAR(VAR_RESTART_KEY)) {
 		confirmRestartDialog();
 
-	} else if (VAR_PAUSE_KEY != 0xFF && lastKeyHit == VAR(VAR_PAUSE_KEY)) {
+	} else if (VAR_PAUSE_KEY != 0xFF && lastKeyHit.ascii == VAR(VAR_PAUSE_KEY)) {
 		pauseGame();
 
-	} else if (VAR_TALKSTOP_KEY != 0xFF && lastKeyHit == VAR(VAR_TALKSTOP_KEY)) {
+	} else if (VAR_TALKSTOP_KEY != 0xFF && lastKeyHit.ascii == VAR(VAR_TALKSTOP_KEY)) {
 		_talkDelay = 0;
 		if (_sound->_sfxMode & 2)
 			stopTalk();
 
 	} else {
-		if (VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY)) {
+		if (VAR_CUTSCENEEXIT_KEY != 0xFF && lastKeyHit.ascii == VAR(VAR_CUTSCENEEXIT_KEY)) {
 			abortCutscene();
-		} else if (lastKeyHit == '[' || lastKeyHit == ']') { // Change music volume
+		} else if (lastKeyHit.ascii == '[' || lastKeyHit.ascii == ']') { // Change music volume
 			int vol = ConfMan.getInt("music_volume") / 16;
-			if (lastKeyHit == ']' && vol < 16)
+			if (lastKeyHit.ascii == ']' && vol < 16)
 				vol++;
-			else if (lastKeyHit == '[' && vol > 0)
+			else if (lastKeyHit.ascii == '[' && vol > 0)
 				vol--;
 	
 			// Display the music volume
@@ -570,10 +589,10 @@
 	
 			ConfMan.setInt("music_volume", vol);
 			updateSoundSettings();
-		} else if (lastKeyHit == '-' || lastKeyHit == '+') { // Change text speed
-			if (lastKeyHit == '+' && _defaultTalkDelay > 0)
+		} else if (lastKeyHit.ascii == '-' || lastKeyHit.ascii == '+') { // Change text speed
+			if (lastKeyHit.ascii == '+' && _defaultTalkDelay > 0)
 				_defaultTalkDelay--;
-			else if (lastKeyHit == '-' && _defaultTalkDelay < 9)
+			else if (lastKeyHit.ascii == '-' && _defaultTalkDelay < 9)
 				_defaultTalkDelay++;
 	
 			// Display the talk speed
@@ -585,11 +604,11 @@
 	
 			if (VAR_CHARINC != 0xFF)
 				VAR(VAR_CHARINC) = _defaultTalkDelay;
-		} else if (lastKeyHit == '~' || lastKeyHit == '#') { // Debug console
+		} else if (lastKeyHit.ascii == '~' || lastKeyHit.ascii == '#') { // Debug console
 			_debugger->attach();
 		}
 	
-		_mouseAndKeyboardStat = lastKeyHit;
+		_mouseAndKeyboardStat = lastKeyHit.ascii;
 	}
 }
 

Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h	2007-06-23 10:06:39 UTC (rev 27654)
+++ scummvm/trunk/engines/scumm/intern.h	2007-06-23 10:38:03 UTC (rev 27655)
@@ -241,7 +241,7 @@
 	virtual void readRoomsOffsets();
 	virtual void loadCharset(int no);
 
-	virtual void processKeyboard(int lastKeyHit);
+	virtual void processKeyboard(Common::KeyState lastKeyHit);
 };
 
 /**
@@ -305,7 +305,7 @@
 	virtual void resetScummVars();
 	virtual void decodeParseString();
 
-	virtual void processKeyboard(int lastKeyHit);
+	virtual void processKeyboard(Common::KeyState lastKeyHit);
 
 	virtual void readIndexFile();
 	void readClassicIndexFile();	// V1
@@ -611,7 +611,7 @@
 	virtual const char *getOpcodeDesc(byte i);
 
 	virtual void scummLoop_handleActors();
-	virtual void processKeyboard(int lastKeyHit);
+	virtual void processKeyboard(Common::KeyState lastKeyHit);
 
 	virtual void setupScummVars();
 	virtual void decodeParseString(int a, int b);
@@ -912,7 +912,7 @@
 
 	virtual void scummLoop_handleSound();
 	virtual void scummLoop_handleDrawing();
-	virtual void processKeyboard(int lastKeyHit);
+	virtual void processKeyboard(Common::KeyState lastKeyHit);
 
 	virtual void setupScumm();
 
@@ -994,7 +994,7 @@
 
 	virtual int getObjectIdFromOBIM(const byte *obim);
 
-	virtual void processKeyboard(int lastKeyHit);
+	virtual void processKeyboard(Common::KeyState lastKeyHit);
 
 	void desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor);
 

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2007-06-23 10:06:39 UTC (rev 27654)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2007-06-23 10:38:03 UTC (rev 27655)
@@ -180,7 +180,6 @@
 	_curPalIndex = 0;
 	_currentRoom = 0;
 	_egoPositioned = false;
-	_keyPressed = 0;
 	_mouseAndKeyboardStat = 0;
 	_leftBtnPressed = 0;
 	_rightBtnPressed = 0;

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2007-06-23 10:06:39 UTC (rev 27654)
+++ scummvm/trunk/engines/scumm/scumm.h	2007-06-23 10:38:03 UTC (rev 27655)
@@ -29,6 +29,7 @@
 #include "engines/engine.h"
 #include "common/endian.h"
 #include "common/file.h"
+#include "common/keyboard.h"
 #include "common/rect.h"
 #include "common/str.h"
 #include "graphics/surface.h"
@@ -482,7 +483,7 @@
 protected:
 	void waitForTimer(int msec_delay);
 	virtual void processInput();
-	virtual void processKeyboard(int lastKeyHit);
+	virtual void processKeyboard(Common::KeyState lastKeyHit);
 	virtual void clearClickedStatus();
 
 	// Cursor/palette
@@ -584,7 +585,7 @@
 	Common::String generateFilename(const int room) const;
 
 protected:
-	int _keyPressed;
+	Common::KeyState _keyPressed;
 	bool _keyDownMap[512]; // FIXME - 512 is a guess. it's max(kbd.ascii)
 
 	Common::Point _mouse;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list