From d8cb07251efb68da38b3c20323dd07867b20405f Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Sun, 24 Jan 2010 18:58:57 +0000 Subject: 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 --- engines/cine/various.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'engines') 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 -- cgit v1.2.3