aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-06-21 18:57:10 +0200
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-06-21 18:57:10 +0200
commitb98c178a77187ca2575ce8feac63ffe044f01335 (patch)
tree90a3729cb6c556b3ddd81d67946c66f904f23538 /demos
parentfe7b378a7b850b893e236975ca2f9532c2114113 (diff)
downloaduGFX-b98c178a77187ca2575ce8feac63ffe044f01335.tar.gz
uGFX-b98c178a77187ca2575ce8feac63ffe044f01335.tar.bz2
uGFX-b98c178a77187ca2575ce8feac63ffe044f01335.zip
Updating /demos/3rdparty/doom demo
Diffstat (limited to 'demos')
-rw-r--r--demos/3rdparty/doom/i_video.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/demos/3rdparty/doom/i_video.c b/demos/3rdparty/doom/i_video.c
index 6f045ebf..20761fc9 100644
--- a/demos/3rdparty/doom/i_video.c
+++ b/demos/3rdparty/doom/i_video.c
@@ -124,6 +124,7 @@ int xlatekey(void)
void I_GetEvent(void)
{
event_t event;
+ static uint16_t last_buttons = 0;
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
GEventMouse mev;
@@ -132,8 +133,8 @@ void I_GetEvent(void)
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
ginputGetMouseStatus(0, &mev);
event.type = ev_mouse;
- event.data1 = mev.current_buttons & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE);
- if ((mev.current_buttons ^ mev.last_buttons) & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE)) {
+ event.data1 = mev.buttons & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE);
+ if ((mev.buttons ^ last_buttons) & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE)) {
event.data2 = event.data3 = 0;
} else {
event.data2 = (mev.x - lastmousex) << 2;
@@ -149,6 +150,8 @@ void I_GetEvent(void)
}
}
+ last_buttons = mev.buttons;
+
#endif
#if 0
event_t event;