Support returning the number of touches in the current input to support multi-touch inputs, like using a 2 finger touch to reload or secondary fire in lightgun games

This commit is contained in:
Yoshi Sugawara 2019-06-11 11:49:27 -10:00
parent b69ab4b178
commit 2dde223d23
3 changed files with 7 additions and 0 deletions

View File

@ -1469,6 +1469,8 @@ static int16_t android_input_state(void *data,
return (idx < android->pointer_count) &&
(android->pointer[idx].x != -0x8000) &&
(android->pointer[idx].y != -0x8000);
case RETRO_DEVICE_ID_POINTER_COUNT:
return android->pointer_count;
case RARCH_DEVICE_ID_POINTER_BACK:
{
const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE];
@ -1488,6 +1490,8 @@ static int16_t android_input_state(void *data,
return (idx < android->pointer_count) &&
(android->pointer[idx].full_x != -0x8000) &&
(android->pointer[idx].full_y != -0x8000);
case RETRO_DEVICE_ID_POINTER_COUNT:
return android->pointer_count;
case RARCH_DEVICE_ID_POINTER_BACK:
{
const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE];

View File

@ -281,6 +281,8 @@ static int16_t cocoa_pointer_state(cocoa_input_data_t *apple,
return x;
case RETRO_DEVICE_ID_POINTER_Y:
return y;
case RETRO_DEVICE_ID_POINTER_COUNT:
return apple->touch_count;
}
}

View File

@ -248,6 +248,7 @@ extern "C" {
#define RETRO_DEVICE_ID_POINTER_X 0
#define RETRO_DEVICE_ID_POINTER_Y 1
#define RETRO_DEVICE_ID_POINTER_PRESSED 2
#define RETRO_DEVICE_ID_POINTER_COUNT 3
/* Returned from retro_get_region(). */
#define RETRO_REGION_NTSC 0