diff options
author | Eugene Sandulenko | 2016-04-19 10:37:53 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-04-19 10:37:53 +0200 |
commit | fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa (patch) | |
tree | 092ffce1e890a20636a17eeb934f3bfea4d32f40 /engines/wage/gui.cpp | |
parent | 609dd56b136db3e0bdfc7906bdc386403e4a1192 (diff) | |
download | scummvm-rg350-fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa.tar.gz scummvm-rg350-fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa.tar.bz2 scummvm-rg350-fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa.zip |
WAGE: Switched event processing to generic code
Diffstat (limited to 'engines/wage/gui.cpp')
-rw-r--r-- | engines/wage/gui.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 8833f7f63d..5bb342fcab 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -55,10 +55,10 @@ #include "wage/wage.h" #include "wage/design.h" #include "wage/entities.h" +#include "wage/gui.h" #include "wage/macwindow.h" #include "wage/macwindowmanager.h" #include "wage/menu.h" -#include "wage/gui.h" #include "wage/world.h" namespace Wage { @@ -540,6 +540,32 @@ void Gui::popCursor() { CursorMan.popCursor(); } +bool Gui::processEvent(Common::Event &event) { + if (_wm.processEvent(event)) + return true; + + switch (event.type) { + case Common::EVENT_MOUSEMOVE: + mouseMove(event.mouse.x, event.mouse.y); + break; + case Common::EVENT_LBUTTONDOWN: + mouseDown(event.mouse.x, event.mouse.y); + break; + case Common::EVENT_LBUTTONUP: + { + Designed *obj = mouseUp(event.mouse.x, event.mouse.y); + if (obj != NULL) + _engine->processTurn(NULL, obj); + } + break; + + default: + return false; + } + + return true; +} + static int isInBorder(Common::Rect &rect, int x, int y) { if (x >= rect.left - kBorderWidth && x < rect.left && y >= rect.top - kBorderWidth && y < rect.top) return kBorderCloseButton; @@ -645,8 +671,6 @@ Designed *Gui::mouseUp(int x, int y) { void Gui::mouseDown(int x, int y) { int borderClick; - _wm.mouseDown(x, y); - if (_menu->mouseClick(x, y)) { _menuDirty = true; } else if (_consoleTextArea.contains(x, y)) { |