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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Jun 23 18:46:01 CEST 2007


Revision: 27677
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27677&view=rev
Author:   fingolfin
Date:     2007-06-23 09:46:00 -0700 (Sat, 23 Jun 2007)

Log Message:
-----------
Cleanup; also fixed Alt-F5 (orig. saveload menu) in COMI

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

Modified: scummvm/trunk/engines/scumm/input.cpp
===================================================================
--- scummvm/trunk/engines/scumm/input.cpp	2007-06-23 16:37:42 UTC (rev 27676)
+++ scummvm/trunk/engines/scumm/input.cpp	2007-06-23 16:46:00 UTC (rev 27677)
@@ -341,7 +341,7 @@
 	if (lastKeyHit.ascii == KEY_ALL_SKIP) {
 		// Skip talk
 		if (VAR_TALKSTOP_KEY != 0xFF && _talkDelay > 0) {
-			lastKeyHit = Common::KeyState(Common::KEYCODE_PERIOD, '.');
+			lastKeyHit = Common::KeyState(Common::KEYCODE_PERIOD);
 		} else {
 			lastKeyHit = Common::KeyState(Common::KEYCODE_ESCAPE);
 		}
@@ -360,17 +360,17 @@
 	if (!(_game.features & GF_DEMO)) {
 		// F1 (the trigger for the original save/load dialog) is mapped to F5
 		if (lastKeyHit.keycode == Common::KEYCODE_F1 && lastKeyHit.flags == 0) {
-			lastKeyHit = Common::KeyState(Common::KEYCODE_F5);
+			lastKeyHit = Common::KeyState(Common::KEYCODE_F5, 319);
 		}
 	
 		// Alt-F5 brings up the original save/load dialog
 		if (lastKeyHit.keycode == Common::KEYCODE_F5 && lastKeyHit.flags == Common::KBD_ALT) {
-			lastKeyHit = Common::KeyState(Common::KEYCODE_F1);
+			lastKeyHit = Common::KeyState(Common::KEYCODE_F1, 315);
 		}
 	}
 
 	// If a key script was specified (a V8 feature), and it's trigger
-	// key was pressed, run it.
+	// key was pressed, run it. Usually used to display the built-in menu.
 	if (_keyScriptNo && (_keyScriptKey == lastKeyHit.ascii)) {
 		runScript(_keyScriptNo, 0, 0, 0);
 		return;
@@ -381,6 +381,7 @@
 }
 
 void ScummEngine_v7::processKeyboard(Common::KeyState lastKeyHit) {
+	const bool cutsceneExitKeyEnabled = (VAR_CUTSCENEEXIT_KEY == 0xFF || VAR(VAR_CUTSCENEEXIT_KEY) != 0);
 
 	// VAR_VERSION_KEY (usually ctrl-v) is used in COMI, Dig and FT to trigger
 	// a version dialog, unless VAR_VERSION_KEY is set to 0. However, the COMI
@@ -389,12 +390,8 @@
 	if (_game.id != GID_CMI && 0 != VAR(VAR_VERSION_KEY) &&
 	    lastKeyHit.keycode == Common::KEYCODE_v && lastKeyHit.flags == Common::KBD_CTRL) {
 		versionDialog();
-		return;
-	}
 
-	const bool cutsceneExitKeyEnabled = (VAR_CUTSCENEEXIT_KEY == 0xFF || VAR(VAR_CUTSCENEEXIT_KEY) != 0);
-
-	if (cutsceneExitKeyEnabled && lastKeyHit.keycode == Common::KEYCODE_ESCAPE) {
+	} else if (cutsceneExitKeyEnabled && lastKeyHit.keycode == Common::KEYCODE_ESCAPE) {
 		// Skip cutscene (or active SMUSH video).
 		if (_smushActive) {
 			if (_game.id == GID_FT)
@@ -406,11 +403,11 @@
 			abortCutscene();
 
 		_mouseAndKeyboardStat = Common::ASCII_ESCAPE;
-		return;
-	}
 
-	// Fall back to V6 behavior
-	ScummEngine_v6::processKeyboard(lastKeyHit);
+	} else {
+		// Fall back to V6 behavior
+		ScummEngine_v6::processKeyboard(lastKeyHit);
+	}
 }
 #endif
 
@@ -511,12 +508,7 @@
 		mainmenuKeyEnabled = true;
 */
 
-	// Alt-F5 should bring up the original save/load dialog, if any.
-	// Hence remap it to F5
-	if ((_game.version > 2 && _game.version < 8) && (lastKeyHit.keycode == Common::KEYCODE_F5 && lastKeyHit.flags == Common::KBD_ALT)) {
-		_mouseAndKeyboardStat = 319;	// SCUMM encoding for F5
-
-	} else if (mainmenuKeyEnabled && (lastKeyHit.keycode == Common::KEYCODE_F5 && lastKeyHit.flags == 0)) {
+	if (mainmenuKeyEnabled && (lastKeyHit.keycode == Common::KEYCODE_F5 && lastKeyHit.flags == 0)) {
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
 			runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0);
 


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