diff options
author | Kari Salminen | 2010-01-24 18:20:22 +0000 |
---|---|---|
committer | Kari Salminen | 2010-01-24 18:20:22 +0000 |
commit | 7ce227b6700b55c1bc343c82d26eb70aea0f0450 (patch) | |
tree | da7f19c9424a9eb8ec34711f4d4e307ec5e93680 | |
parent | 40cb795fe7bee0576026fd45fe8abc29485b6dc1 (diff) | |
download | scummvm-rg350-7ce227b6700b55c1bc343c82d26eb70aea0f0450.tar.gz scummvm-rg350-7ce227b6700b55c1bc343c82d26eb70aea0f0450.tar.bz2 scummvm-rg350-7ce227b6700b55c1bc343c82d26eb70aea0f0450.zip |
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
-rw-r--r-- | engines/cine/various.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
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; |