mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
input_state_internal - small cleanup for RETRO_DEVICE_JOYPAD
This commit is contained in:
parent
f94a924be9
commit
5aebbdfddb
37
retroarch.c
37
retroarch.c
@ -3315,33 +3315,24 @@ static int16_t input_state_internal(
|
|||||||
bool bind_valid = libretro_input_binds[port]
|
bool bind_valid = libretro_input_binds[port]
|
||||||
&& libretro_input_binds[port][id].valid;
|
&& libretro_input_binds[port][id].valid;
|
||||||
|
|
||||||
if (bind_valid)
|
if (settings->bools.input_remap_binds_enable &&
|
||||||
|
id != settings->uints.input_remap_ids[port][id])
|
||||||
|
res = 0;
|
||||||
|
else if (bind_valid)
|
||||||
{
|
{
|
||||||
/* reset_state - used to reset input state of a button
|
if (button_mask)
|
||||||
* when the gamepad mapper is in action for that button*/
|
|
||||||
bool reset_state = false;
|
|
||||||
if (settings->bools.input_remap_binds_enable)
|
|
||||||
if (id != settings->uints.input_remap_ids[port][id])
|
|
||||||
reset_state = true;
|
|
||||||
|
|
||||||
if (!reset_state)
|
|
||||||
{
|
{
|
||||||
if (button_mask)
|
res = 0;
|
||||||
{
|
if (ret & (1 << id))
|
||||||
res = 0;
|
res |= (1 << id);
|
||||||
if (ret & (1 << id))
|
|
||||||
res |= (1 << id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
res = ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
|
||||||
if (input_overlay_is_alive(overlay_ptr) && port == 0)
|
|
||||||
res |= res_overlay;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
res = 0;
|
res = ret;
|
||||||
|
|
||||||
|
#ifdef HAVE_OVERLAY
|
||||||
|
if (input_overlay_is_alive(overlay_ptr) && port == 0)
|
||||||
|
res |= res_overlay;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user