From 7fcb26bded72a513dc68aa70f5d88a9f79721a7d Mon Sep 17 00:00:00 2001 From: meancoot Date: Fri, 29 Mar 2013 20:32:45 -0400 Subject: [PATCH] (iOS) Differentiate between RETRO_DEVICE_POINTER and RARCH_DEVICE_POINTER_SCREEN. --- ios/RetroArch/input/ios_input.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ios/RetroArch/input/ios_input.c b/ios/RetroArch/input/ios_input.c index c349831d26..8ed6111b96 100644 --- a/ios/RetroArch/input/ios_input.c +++ b/ios/RetroArch/input/ios_input.c @@ -106,9 +106,12 @@ static int16_t ios_input_state(void *data, const struct retro_keybind **binds, u { case RETRO_DEVICE_JOYPAD: return (id < RARCH_BIND_LIST_END) ? ios_is_pressed(port, &binds[port][id]) : false; - + + case RETRO_DEVICE_POINTER: case RARCH_DEVICE_POINTER_SCREEN: { + const bool want_full = device == RARCH_DEVICE_POINTER_SCREEN; + if (index < ios_touch_count && index < MAX_TOUCHES) { const touch_data_t* touch = &ios_touch_list[index]; @@ -116,8 +119,8 @@ static int16_t ios_input_state(void *data, const struct retro_keybind **binds, u switch (id) { case RETRO_DEVICE_ID_POINTER_PRESSED: return 1; - case RETRO_DEVICE_ID_POINTER_X: return touch->full_x; - case RETRO_DEVICE_ID_POINTER_Y: return touch->full_y; + case RETRO_DEVICE_ID_POINTER_X: return want_full ? touch->full_x : touch->fixed_x; + case RETRO_DEVICE_ID_POINTER_Y: return want_full ? touch->full_y : touch->fixed_y; } }