mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Increase MAX_TOUCH.
Ensure that we don't set data outside array. Warn if this happens.
This commit is contained in:
parent
410e32b64a
commit
c3ff164919
@ -23,7 +23,7 @@
|
||||
#include "../../../general.h"
|
||||
#include "../../../driver.h"
|
||||
|
||||
#define MAX_TOUCH 8
|
||||
#define MAX_TOUCH 16
|
||||
|
||||
#define PRESSED_UP(x, y) ((-0.80f > y) && (x >= -1.00f))
|
||||
#define PRESSED_DOWN(x, y) ((0.80f < y) && (y <= 1.00f))
|
||||
@ -155,6 +155,8 @@ static void android_input_poll(void *data)
|
||||
action == AMOTION_EVENT_ACTION_CANCEL || action == AMOTION_EVENT_ACTION_POINTER_UP) ||
|
||||
(source == AINPUT_SOURCE_MOUSE && action != AMOTION_EVENT_ACTION_DOWN);
|
||||
|
||||
if (motion_pointer < MAX_TOUCH)
|
||||
{
|
||||
if (!keyup)
|
||||
{
|
||||
x = AMotionEvent_getX(event, motion_pointer);
|
||||
@ -171,6 +173,9 @@ static void android_input_poll(void *data)
|
||||
pointer_count--;
|
||||
}
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Got motion pointer out of range (index: %u).\n", motion_pointer);
|
||||
}
|
||||
|
||||
if (debug_enable)
|
||||
snprintf(msg, sizeof(msg), "Pad %d : x = %.2f, y = %.2f, src %d.\n", state_id, x, y, source);
|
||||
|
Loading…
x
Reference in New Issue
Block a user