From 7ce227b6700b55c1bc343c82d26eb70aea0f0450 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Sun, 24 Jan 2010 18:20:22 +0000 Subject: 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). svn-id: r47508 --- engines/cine/various.cpp | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'engines/cine') diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 0a9e7eb8eb..cc9003a646 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -823,7 +823,7 @@ void makeActionMenu() { if (playerCommand >= 8000) { playerCommand -= 8000; - canUseOnObject = 1; + canUseOnObject = canUseOnItemTable[playerCommand]; } } else { playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70); @@ -876,7 +876,11 @@ uint16 executePlayerInput() { // 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 @@ uint16 executePlayerInput() { 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 @@ uint16 executePlayerInput() { 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; -- cgit v1.2.3