mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
input_joypad_pressed - cleanup
This commit is contained in:
parent
5eed4fd897
commit
b7d845df77
@ -85,15 +85,17 @@ static bool input_joypad_is_pressed(
|
|||||||
const struct retro_keybind *binds,
|
const struct retro_keybind *binds,
|
||||||
unsigned key)
|
unsigned key)
|
||||||
{
|
{
|
||||||
const struct retro_keybind *auto_binds;
|
|
||||||
float scaled_axis;
|
float scaled_axis;
|
||||||
int16_t axis;
|
int16_t axis;
|
||||||
uint32_t joyaxis;
|
uint32_t joyaxis;
|
||||||
uint64_t joykey;
|
uint64_t joykey;
|
||||||
|
const struct retro_keybind *auto_binds = NULL;
|
||||||
unsigned joy_idx = g_settings.input.joypad_map[port];
|
unsigned joy_idx = g_settings.input.joypad_map[port];
|
||||||
|
|
||||||
if (joy_idx >= MAX_USERS)
|
if (joy_idx >= MAX_USERS)
|
||||||
return false;
|
return false;
|
||||||
|
if (!drv || !binds[key].valid)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* Auto-binds are per joypad, not per user. */
|
/* Auto-binds are per joypad, not per user. */
|
||||||
auto_binds = g_settings.input.autoconf_binds[joy_idx];
|
auto_binds = g_settings.input.autoconf_binds[joy_idx];
|
||||||
@ -130,8 +132,7 @@ static bool input_joypad_is_pressed(
|
|||||||
bool input_joypad_pressed(const rarch_joypad_driver_t *drv,
|
bool input_joypad_pressed(const rarch_joypad_driver_t *drv,
|
||||||
unsigned port, const struct retro_keybind *binds, unsigned key)
|
unsigned port, const struct retro_keybind *binds, unsigned key)
|
||||||
{
|
{
|
||||||
if (!drv || !binds[key].valid ||
|
if (!input_joypad_is_pressed(drv, port, binds, key))
|
||||||
!input_joypad_is_pressed(drv, port, binds, key))
|
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user