From: Holger Schemel Date: Sun, 4 Oct 2020 22:55:29 +0000 (+0200) Subject: added clearing touch info when clearing player action X-Git-Tag: 4.2.0.3~7 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7ef815fdafe95d07ab7b2527033900890b50d370;p=rocksndiamonds.git added clearing touch info when clearing player action --- diff --git a/src/events.c b/src/events.c index 41b60832..a7732a8e 100644 --- a/src/events.c +++ b/src/events.c @@ -43,6 +43,7 @@ static boolean stop_processing_events = FALSE; // forward declarations for internal use +static void ClearTouchInfo(void); static void HandleNoEvent(void); static void HandleEventActions(void); @@ -442,6 +443,7 @@ void ClearPlayerAction(void) stored_player[i].snap_action = 0; } + ClearTouchInfo(); ClearJoystickState(); ClearPlayerMouseAction(); } @@ -708,6 +710,14 @@ static void SetTouchInfo(int pos, SDL_FingerID finger_id, int counter, 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;