From 3e51ed6a785ffb1871ffdbfff6aaad309959a1ee Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Tue, 22 Oct 2013 12:02:03 +0700 Subject: ZVISION: Set right reaction for mouse up/down events. --- engines/zvision/events.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/zvision/events.cpp b/engines/zvision/events.cpp index 1103dc3000..ede91273e6 100644 --- a/engines/zvision/events.cpp +++ b/engines/zvision/events.cpp @@ -43,17 +43,28 @@ void ZVision::processEvents() { while (_eventMan->pollEvent(_event)) { switch (_event.type) { case Common::EVENT_LBUTTONDOWN: + _cursorManager->cursorDown(true); + _scriptManager->setStateValue(StateKey_LMouse, 1); onMouseDown(_event.mouse); break; case Common::EVENT_LBUTTONUP: + _cursorManager->cursorDown(false); + _scriptManager->setStateValue(StateKey_LMouse, 0); onMouseUp(_event.mouse); break; case Common::EVENT_RBUTTONDOWN: + _cursorManager->cursorDown(true); + _scriptManager->setStateValue(StateKey_RMouse, 1); // TODO: Inventory logic break; + case Common::EVENT_RBUTTONUP: + _cursorManager->cursorDown(false); + _scriptManager->setStateValue(StateKey_RMouse, 0); + break; + case Common::EVENT_MOUSEMOVE: onMouseMove(_event.mouse); break; @@ -87,15 +98,11 @@ void ZVision::processEvents() { } void ZVision::onMouseDown(const Common::Point &pos) { - _cursorManager->cursorDown(true); - Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); _scriptManager->onMouseDown(pos, imageCoord); } void ZVision::onMouseUp(const Common::Point &pos) { - _cursorManager->cursorDown(false); - Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); _scriptManager->onMouseUp(pos, imageCoord); } -- cgit v1.2.3