diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-22 00:38:17 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-22 00:38:17 +0200 |
commit | 0ff419560d5a567afaa0294968cc1f5b5e6b597b (patch) | |
tree | 03edeac0b7850348b9b910e0d39dd88a477afd75 /src/ui/control.cpp | |
parent | 15ff1d512b9e103396144bec1cd8004ecf4f7f9c (diff) | |
download | colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.tar.gz colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.tar.bz2 colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.zip |
Event fixes & refactoring
- added new state tracking to Event
- removed old fields from Event
- fixed some issues with Events and fps counter
Diffstat (limited to 'src/ui/control.cpp')
-rw-r--r-- | src/ui/control.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp index fbf7575..16769d1 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -304,9 +304,9 @@ bool CControl::EventProcess(const Event &event) if ( event.type == EVENT_MOUSE_MOVE ) { - m_glintMouse = event.mouseMove.pos; + m_glintMouse = event.mousePos; - if ( Detect(event.mouseMove.pos) ) + if ( Detect(event.mousePos) ) { if ( (m_state & STATE_VISIBLE) && (m_state & STATE_ENABLE ) ) @@ -321,9 +321,9 @@ bool CControl::EventProcess(const Event &event) } } - if ( event.type == EVENT_MOUSE_BUTTON_DOWN && event.mouseButton.button == 1) + if ( event.type == EVENT_MOUSE_BUTTON_DOWN && event.mouseButton.button == MOUSE_BUTTON_LEFT) { - if ( Detect(event.mouseButton.pos) ) + if ( Detect(event.mousePos) ) { m_bCapture = true; SetState(STATE_PRESS); @@ -332,7 +332,7 @@ bool CControl::EventProcess(const Event &event) if ( event.type == EVENT_MOUSE_MOVE && m_bCapture ) { - if ( Detect(event.mouseMove.pos) ) + if ( Detect(event.mousePos) ) { SetState(STATE_PRESS); } @@ -342,7 +342,7 @@ bool CControl::EventProcess(const Event &event) } } - if ( event.type == EVENT_MOUSE_BUTTON_UP && m_bCapture && event.mouseButton.button == 1) + if ( event.type == EVENT_MOUSE_BUTTON_UP && m_bCapture && event.mouseButton.button == MOUSE_BUTTON_LEFT) { m_bCapture = false; ClearState(STATE_PRESS); |