projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed unnecessary screen redraws when waiting for events to continue
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 41b60832fa50f92d165da235a709403b24d034d4..aade635e02388745f5679e3336d1f11ffb731e80 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-43,6
+43,7
@@
static boolean stop_processing_events = FALSE;
// forward declarations for internal use
// forward declarations for internal use
+static void ClearTouchInfo(void);
static void HandleNoEvent(void);
static void HandleEventActions(void);
static void HandleNoEvent(void);
static void HandleEventActions(void);
@@
-407,6
+408,7
@@
void ClearEventQueue(void)
button_status = MB_RELEASED;
break;
button_status = MB_RELEASED;
break;
+ case EVENT_FINGERRELEASE:
case EVENT_KEYRELEASE:
ClearPlayerAction();
break;
case EVENT_KEYRELEASE:
ClearPlayerAction();
break;
@@
-442,6
+444,10
@@
void ClearPlayerAction(void)
stored_player[i].snap_action = 0;
}
stored_player[i].snap_action = 0;
}
+ // simulate finger release events for still pressed virtual buttons
+ overlay.grid_button_action = JOY_NO_ACTION;
+
+ ClearTouchInfo();
ClearJoystickState();
ClearPlayerMouseAction();
}
ClearJoystickState();
ClearPlayerMouseAction();
}
@@
-708,6
+714,14
@@
static void SetTouchInfo(int pos, SDL_FingerID finger_id, int counter,
touch_info[pos].action = action;
}
touch_info[pos].action = action;
}
+static void ClearTouchInfo(void)
+{
+ int i;
+
+ for (i = 0; i < NUM_TOUCH_FINGERS; i++)
+ SetTouchInfo(i, 0, 0, 0, JOY_NO_ACTION);
+}
+
static void HandleFingerEvent_VirtualButtons(FingerEvent *event)
{
int x = event->x * overlay.grid_xsize;
static void HandleFingerEvent_VirtualButtons(FingerEvent *event)
{
int x = event->x * overlay.grid_xsize;