From 42a85dafa671efaf96fe174a49ab83a212a1a437 Mon Sep 17 00:00:00 2001 From: CatalystG Date: Thu, 20 Jun 2013 20:41:46 -0400 Subject: [PATCH] (BlackBerry) Fix overlay issues including multitouch weirdness. --- blackberry-qnx/qnx_input.c | 79 ++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/blackberry-qnx/qnx_input.c b/blackberry-qnx/qnx_input.c index 7acfe5132e..0b5c499d85 100644 --- a/blackberry-qnx/qnx_input.c +++ b/blackberry-qnx/qnx_input.c @@ -22,17 +22,25 @@ #include "frontend_qnx.h" +#ifdef HAVE_BB10 #define MAX_TOUCH 16 +#else +#define MAX_TOUCH 4 +#endif struct touches { int16_t x, y; int16_t full_x, full_y; int contact_id; + int map; }; static struct touches touch[MAX_TOUCH]; static unsigned touch_count; +//The first touch_count indices of touch_map will be a valid, active index in touch array. +//Saves us from searching through touch array when polling state. +static int touch_map[MAX_TOUCH]; input_device_t devices[MAX_PADS]; input_device_t *port_device[MAX_PADS]; @@ -293,21 +301,48 @@ static void process_touch_event(screen_event_t event, int type) switch(type) { case SCREEN_EVENT_MTOUCH_TOUCH: - touch[touch_count].contact_id = contact_id; - input_translate_coord_viewport(pos[0], pos[1], - &touch[touch_count].x, &touch[touch_count].y, - &touch[touch_count].full_x, &touch[touch_count].full_y); - touch_count++; + //Find a free touch struct + for(i=0;i