From a0f6bf1fe5bd84fb3b4b36b7cdcd750febbbca09 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 30 Jun 2014 00:12:33 +0200 Subject: [PATCH] (QNX) Input driver - use driver.video_data directly --- input/qnx_input.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/input/qnx_input.c b/input/qnx_input.c index 6a78ad727e..16c6b2c16f 100644 --- a/input/qnx_input.c +++ b/input/qnx_input.c @@ -73,7 +73,6 @@ typedef struct qnx_input input_device_t *port_device[MAX_PADS]; input_device_t devices[MAX_PADS]; const rarch_joypad_driver_t *joypad; - unsigned screen_width, screen_height; int16_t analog_state[MAX_PADS][2][2]; uint64_t pad_state[MAX_PADS]; } qnx_input_t; @@ -410,17 +409,19 @@ static void process_touch_event(void *data, screen_event_t event, int type) { if(qnx->pointer[i].contact_id == contact_id) { + gl_t *gl = (gl_t*)driver.video_data; + //During a move, we can go ~30 pixel into the bezel which gives negative //numbers or numbers larger than the screen res. Normalize. if(pos[0] < 0) pos[0] = 0; - if(pos[0] > qnx->screen_width) - pos[0] = qnx->screen_width; + if(pos[0] > gl->full_x) + pos[0] = gl->full_x; if(pos[1] < 0) pos[1] = 0; - if(pos[1] > qnx->screen_height) - pos[1] = qnx->screen_height; + if(pos[1] > gl->full_y) + pos[1] = gl->full_y; input_translate_coord_viewport(pos[0], pos[1], &qnx->pointer[i].x, &qnx->pointer[i].y, @@ -562,10 +563,6 @@ static void *qnx_input_init(void) if (!qnx) return NULL; - //Get screen dimensions - if(gfx_ctx_bbqnx.get_video_size) - gfx_ctx_bbqnx.get_video_size(driver.video_data, &qnx->screen_width, &qnx->screen_height); - for (i = 0; i < MAX_TOUCH; ++i) { qnx->pointer[i].contact_id = -1;