mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(Android) Fix one potential crash on older Android
This commit is contained in:
parent
9e39220390
commit
09c727c0ee
@ -1359,20 +1359,27 @@ static void android_input_poll_memcpy(android_input_t *android)
|
|||||||
|
|
||||||
static bool android_input_key_pressed(android_input_t *android, int key)
|
static bool android_input_key_pressed(android_input_t *android, int key)
|
||||||
{
|
{
|
||||||
|
uint16_t joykey;
|
||||||
|
uint32_t joyaxis;
|
||||||
rarch_joypad_info_t joypad_info;
|
rarch_joypad_info_t joypad_info;
|
||||||
const uint16_t joykey = (input_config_binds[0][key].joykey != NO_BTN)
|
joypad_info.joy_idx = 0;
|
||||||
? input_config_binds[0][key].joykey : joypad_info.auto_binds[key].joykey;
|
joypad_info.auto_binds = input_autoconf_binds[0];
|
||||||
const uint32_t joyaxis = (input_config_binds[0][key].joyaxis != AXIS_NONE)
|
joypad_info.axis_threshold = *
|
||||||
? input_config_binds[0][key].joyaxis : joypad_info.auto_binds[key].joyaxis;
|
(input_driver_get_float(INPUT_ACTION_AXIS_THRESHOLD));
|
||||||
|
|
||||||
if((key < RARCH_BIND_LIST_END)
|
if((key < RARCH_BIND_LIST_END)
|
||||||
&& android_keyboard_port_input_pressed(input_config_binds[0],
|
&& android_keyboard_port_input_pressed(input_config_binds[0],
|
||||||
key))
|
key))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
joypad_info.joy_idx = 0;
|
joykey =
|
||||||
joypad_info.auto_binds = input_autoconf_binds[0];
|
(input_config_binds[0][key].joykey != NO_BTN)
|
||||||
joypad_info.axis_threshold = *(input_driver_get_float(INPUT_ACTION_AXIS_THRESHOLD));
|
? input_config_binds[0][key].joykey
|
||||||
|
: joypad_info.auto_binds[key].joykey;
|
||||||
|
joyaxis =
|
||||||
|
(input_config_binds[0][key].joyaxis != AXIS_NONE)
|
||||||
|
? input_config_binds[0][key].joyaxis
|
||||||
|
: joypad_info.auto_binds[key].joyaxis;
|
||||||
|
|
||||||
if (joykey != NO_BTN && android->joypad->button(joypad_info.joy_idx, joykey))
|
if (joykey != NO_BTN && android->joypad->button(joypad_info.joy_idx, joykey))
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user