diff options
author | Kari Salminen | 2010-01-24 18:58:57 +0000 |
---|---|---|
committer | Kari Salminen | 2010-01-24 18:58:57 +0000 |
commit | d8cb07251efb68da38b3c20323dd07867b20405f (patch) | |
tree | ccecfa1a8235dce50892230710d63be8b82196c9 /engines/cine | |
parent | e7e90061228b4a680fa0a15cdfca413636d22396 (diff) | |
download | scummvm-rg350-d8cb07251efb68da38b3c20323dd07867b20405f.tar.gz scummvm-rg350-d8cb07251efb68da38b3c20323dd07867b20405f.tar.bz2 scummvm-rg350-d8cb07251efb68da38b3c20323dd07867b20405f.zip |
Cine: executePlayerInput: Implement 'A player command is given, left mouse button is down, right mouse button is up'-case for Operation Stealth.
- Also changed a do-while -loop into a
while-loop as it should be for both
FW and OS according to disassembly.
svn-id: r47512
Diffstat (limited to 'engines/cine')
-rw-r--r-- | engines/cine/various.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 7f9c13b147..1998f4264b 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -885,13 +885,12 @@ uint16 executePlayerInput() { if (!(mouseButton & kRightMouseButton)) { // Right mouse button is up // A player command is given, left mouse button is down, right mouse button is up int16 si; - do { + while (mouseButton && !g_cine->shouldQuit()) { manageEvents(); getMouseData(mouseUpdateStatus, &mouseButton, &dummyU16, &dummyU16); - } while (mouseButton && !g_cine->shouldQuit()); + } - si = getObjectUnderCursor(mouseX, - mouseY); + si = getObjectUnderCursor(mouseX, mouseY); if (si != -1) { commandVar3[commandVar1] = si; @@ -900,7 +899,6 @@ uint16 executePlayerInput() { commandBuffer += " "; commandBuffer += objectTable[si].name; - isDrawCommandEnabled = 1; if (choiceResultTable[playerCommand] == commandVar1) { @@ -922,11 +920,27 @@ uint16 executePlayerInput() { commandVar1 = 0; commandBuffer = ""; - renderer->setCommand(commandBuffer); + } else if (g_cine->getGameType() == Cine::GType_OS) { + isDrawCommandEnabled = 1; + commandBuffer += commandPrepositionTable[playerCommand]; } + + renderer->setCommand(commandBuffer); } else { globalVars[VAR_MOUSE_X_POS] = mouseX; + if (!mouseX) { + globalVars[VAR_MOUSE_X_POS]++; + } + globalVars[VAR_MOUSE_Y_POS] = mouseY; + + if (g_cine->getGameType() == Cine::GType_OS) { + if (!mouseY) { + globalVars[VAR_MOUSE_Y_POS]++; + } + globalVars[VAR_MOUSE_X_POS_2ND] = globalVars[VAR_MOUSE_X_POS]; + globalVars[VAR_MOUSE_Y_POS_2ND] = globalVars[VAR_MOUSE_X_POS]; + } } } } else if (!(mouseButton & kRightMouseButton)) { // Right mouse button is up |