aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2013-10-22 12:02:03 +0700
committerMarisa-Chan2013-10-22 12:02:03 +0700
commit3e51ed6a785ffb1871ffdbfff6aaad309959a1ee (patch)
tree69b183ed20917568dc3697e2707cdcc507c4ef88
parent9888e66603e1377ff370cbf667efba9d49d5e45d (diff)
downloadscummvm-rg350-3e51ed6a785ffb1871ffdbfff6aaad309959a1ee.tar.gz
scummvm-rg350-3e51ed6a785ffb1871ffdbfff6aaad309959a1ee.tar.bz2
scummvm-rg350-3e51ed6a785ffb1871ffdbfff6aaad309959a1ee.zip
ZVISION: Set right reaction for mouse up/down events.
-rw-r--r--engines/zvision/events.cpp15
1 files changed, 11 insertions, 4 deletions
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);
}