projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20131210-1-src
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 122311d1a527345b924ce8bca12673dca7d216e8..8f595ecef284cc199912d6f8023f015912a1fc13 100644
(file)
--- 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 */
/* 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;
{
MotionEvent *motion;
@@
-74,6
+74,18
@@
int FilterEvents(const Event *event)
return 1;
}
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) */
/* 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);
NextEvent(event);
- if (Filter
MouseMotionEvents
(event))
+ if (Filter
EventsExt
(event))
handle_this_event = TRUE;
if (SkipPressedMouseMotionEvent(event))
handle_this_event = TRUE;
if (SkipPressedMouseMotionEvent(event))
@@
-140,6
+152,13
@@
void EventLoop(void)
{
switch (event.type)
{
{
switch (event.type)
{
+#if defined(PLATFORM_ANDROID)
+ // !!! TEST ONLY !!!
+ case SDL_QUIT:
+ case SDL_FINGERDOWN:
+ CloseAllAndExit(0);
+#endif
+
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
HandleButtonEvent((ButtonEvent *) &event);
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
HandleButtonEvent((ButtonEvent *) &event);