Updating /demos/3rdparty/doom demo
This commit is contained in:
parent
fe7b378a7b
commit
b98c178a77
1 changed files with 5 additions and 2 deletions
7
demos/3rdparty/doom/i_video.c
vendored
7
demos/3rdparty/doom/i_video.c
vendored
|
@ -124,6 +124,7 @@ int xlatekey(void)
|
||||||
void I_GetEvent(void)
|
void I_GetEvent(void)
|
||||||
{
|
{
|
||||||
event_t event;
|
event_t event;
|
||||||
|
static uint16_t last_buttons = 0;
|
||||||
|
|
||||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
||||||
GEventMouse mev;
|
GEventMouse mev;
|
||||||
|
@ -132,8 +133,8 @@ void I_GetEvent(void)
|
||||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
||||||
ginputGetMouseStatus(0, &mev);
|
ginputGetMouseStatus(0, &mev);
|
||||||
event.type = ev_mouse;
|
event.type = ev_mouse;
|
||||||
event.data1 = mev.current_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.current_buttons ^ mev.last_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;
|
event.data2 = event.data3 = 0;
|
||||||
} else {
|
} else {
|
||||||
event.data2 = (mev.x - lastmousex) << 2;
|
event.data2 = (mev.x - lastmousex) << 2;
|
||||||
|
@ -149,6 +150,8 @@ void I_GetEvent(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
last_buttons = mev.buttons;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
event_t event;
|
event_t event;
|
||||||
|
|
Loading…
Add table
Reference in a new issue