[Scummvm-cvs-logs] SF.net SVN: scummvm:[47508] scummvm/trunk/engines/cine/various.cpp

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Sun Jan 24 19:20:22 CET 2010


Revision: 47508
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47508&view=rev
Author:   buddha_
Date:     2010-01-24 18:20:22 +0000 (Sun, 24 Jan 2010)

Log Message:
-----------
Cine: executePlayerInput: Combine 'left mouse button is up, right mouse button is down'-cases into one code part.

Additionally:
 - Operation Stealth specific: Make makeActionMenu() use canUseOnItemTable.
   This would seem to be the correct way according to disassembly
   (Although there is of course a possibility that I have overlooked
   some part of the code).

Modified Paths:
--------------
    scummvm/trunk/engines/cine/various.cpp

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2010-01-24 17:56:23 UTC (rev 47507)
+++ scummvm/trunk/engines/cine/various.cpp	2010-01-24 18:20:22 UTC (rev 47508)
@@ -823,7 +823,7 @@
 
 		if (playerCommand >= 8000) {
 			playerCommand -= 8000;
-			canUseOnObject = 1;
+			canUseOnObject = canUseOnItemTable[playerCommand];
 		}
 	} else {
 		playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70);
@@ -876,7 +876,11 @@
 		// Left and right mouse buttons are down
 		g_cine->makeSystemMenu();
 	} else if (allowPlayerInput) { // Player input is allowed
-		if (playerCommand != -1) { // A player command is given
+		if (!(mouseButton & kLeftMouseButton) && (mouseButton & kRightMouseButton)) {
+			// Player input is allowed, left mouse button is up, right mouse button is down
+			makeActionMenu();
+			makeCommandLine();
+		} else if (playerCommand != -1) { // A player command is given
 			if (mouseButton & kLeftMouseButton) { // Left mouse button is down
 				if (!(mouseButton & kRightMouseButton)) { // Right mouse button is up
 					// A player command is given, left mouse button is down, right mouse button is up
@@ -925,11 +929,7 @@
 						globalVars[VAR_MOUSE_Y_POS] = mouseY;
 					}
 				}
-			} else if (mouseButton & kRightMouseButton) { // Right mouse button is down
-				// A player command is given, left mouse button is up, right mouse button is down
-				makeActionMenu();
-				makeCommandLine();
-			} else { // Left and right mouse buttons are up
+			} else if (!(mouseButton & kRightMouseButton)) { // Right mouse button is up
 				// A player command is given, left and right mouse buttons are up
 				int16 objIdx;
 
@@ -946,23 +946,7 @@
 				commandVar2 = objIdx;
 			}
 		} else { // No player command is given
-			if (mouseButton & kRightMouseButton) { // Right mouse button is down
-				if (!(mouseButton & kLeftMouseButton)) { // Left mouse button is up
-					// No player command is given, left mouse button is up, right mouse button is down
-					if (g_cine->getGameType() == Cine::GType_OS) {
-						playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70, true);
-
-						if (playerCommand >= 8000) {
-							playerCommand -= 8000;
-							canUseOnObject = 1;
-						}
-					} else {
-						playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70);
-					}
-
-					makeCommandLine();
-				}
-			} else { // Right mouse button is up
+			if (!(mouseButton & kRightMouseButton)) { // Right mouse button is up
 				if (mouseButton & kLeftMouseButton) { // Left mouse button is down
 					// No player command is given, left mouse button is down, right mouse button is up
 					int16 objIdx;


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