X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=75e32c717c3a82ff48c8797f4b59bad65db6b868;hb=e5367ee42312c8835125438511d8479aa2daa094;hp=122311d1a527345b924ce8bca12673dca7d216e8;hpb=3ae70b9d27b4b2c038f35b0aa5985c368542a486;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 122311d1..75e32c71 100644 --- a/src/events.c +++ b/src/events.c @@ -39,7 +39,7 @@ static unsigned int playfield_cursor_delay = 0; /* event filter addition for SDL2: as SDL2 does not have a function to enable or disable keyboard auto-repeat, filter repeated keyboard events instead */ -int FilterEvents(const Event *event) +static int FilterEventsExt(const Event *event) { MotionEvent *motion; @@ -74,6 +74,18 @@ int FilterEvents(const Event *event) return 1; } +#if defined(TARGET_SDL2) +int FilterEvents(void *userdata, Event *event) +{ + return FilterEventsExt(event); +} +#else +int FilterEvents(const Event *event) +{ + return FilterEventsExt(event); +} +#endif + /* to prevent delay problems, skip mouse motion events if the very next event is also a mouse motion event (and therefore effectively only handling the last of a row of mouse motion events in the event queue) */ @@ -115,7 +127,7 @@ static boolean NextValidEvent(Event *event) NextEvent(event); - if (FilterMouseMotionEvents(event)) + if (FilterEventsExt(event)) handle_this_event = TRUE; if (SkipPressedMouseMotionEvent(event))