projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
88a1829
)
moved waiting for and filtering events to separate function
author
Holger Schemel
<info@artsoft.org>
Wed, 31 Jan 2018 18:51:19 +0000
(19:51 +0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 31 Jan 2018 18:51:19 +0000
(19:51 +0100)
src/events.c
patch
|
blob
|
history
diff --git
a/src/events.c
b/src/events.c
index 10b866d433f5d72a8cbde3275db3516317af5a0e..10950bd9513e2a993531382756a07658583c7996 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-128,6
+128,19
@@
static boolean SkipPressedMouseMotionEvent(const Event *event)
return FALSE;
}
return FALSE;
}
+static boolean WaitEventFiltered(Event *event)
+{
+ WaitEvent(event);
+
+ if (!FilterEvents(event))
+ return FALSE;
+
+ if (SkipPressedMouseMotionEvent(event))
+ return FALSE;
+
+ return TRUE;
+}
+
/* this is especially needed for event modifications for the Android target:
if mouse coordinates should be modified in the event filter function,
using a properly installed SDL event filter does not work, because in
/* this is especially needed for event modifications for the Android target:
if mouse coordinates should be modified in the event filter function,
using a properly installed SDL event filter does not work, because in
@@
-139,20
+152,8
@@
static boolean SkipPressedMouseMotionEvent(const Event *event)
boolean NextValidEvent(Event *event)
{
while (PendingEvent())
boolean NextValidEvent(Event *event)
{
while (PendingEvent())
- {
- boolean handle_this_event = FALSE;
-
- WaitEvent(event);
-
- if (FilterEvents(event))
- handle_this_event = TRUE;
-
- if (SkipPressedMouseMotionEvent(event))
- handle_this_event = FALSE;
-
- if (handle_this_event)
+ if (WaitEventFiltered(event))
return TRUE;
return TRUE;
- }
return FALSE;
}
return FALSE;
}