From bbaebdf680179dca103b0ed635e791aa602d610d Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Sat, 5 Jul 2014 17:27:08 +0000 Subject: ZVISION: Process events for controls similar to original engine, fix some errors. --- engines/zvision/core/events.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'engines/zvision/core') diff --git a/engines/zvision/core/events.cpp b/engines/zvision/core/events.cpp index 943f8ff279..c977125f55 100644 --- a/engines/zvision/core/events.cpp +++ b/engines/zvision/core/events.cpp @@ -46,13 +46,15 @@ void ZVision::processEvents() { case Common::EVENT_LBUTTONDOWN: _cursorManager->cursorDown(true); _scriptManager->setStateValue(StateKey_LMouse, 1); - onMouseDown(_event.mouse); + _menu->onMouseDown(_event.mouse); + _scriptManager->addEvent(_event); break; case Common::EVENT_LBUTTONUP: _cursorManager->cursorDown(false); _scriptManager->setStateValue(StateKey_LMouse, 0); - onMouseUp(_event.mouse); + _menu->onMouseUp(_event.mouse); + _scriptManager->addEvent(_event); break; case Common::EVENT_RBUTTONDOWN: @@ -87,10 +89,10 @@ void ZVision::processEvents() { break; } - _scriptManager->onKeyDown(_event.kbd); + _scriptManager->addEvent(_event); break; case Common::EVENT_KEYUP: - _scriptManager->onKeyUp(_event.kbd); + _scriptManager->addEvent(_event); break; default: break; @@ -98,20 +100,6 @@ void ZVision::processEvents() { } } -void ZVision::onMouseDown(const Common::Point &pos) { - _menu->onMouseDown(pos); - - Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); - _scriptManager->onMouseDown(pos, imageCoord); -} - -void ZVision::onMouseUp(const Common::Point &pos) { - _menu->onMouseUp(pos); - - Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); - _scriptManager->onMouseUp(pos, imageCoord); -} - void ZVision::onMouseMove(const Common::Point &pos) { _menu->onMouseMove(pos); Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); -- cgit v1.2.3