remap-redux part2: cleanup

This commit is contained in:
radius 2018-04-03 00:28:10 -05:00
parent 5efba1c257
commit e130afff73
3 changed files with 5 additions and 9 deletions

View File

@ -673,9 +673,10 @@ int16_t input_state(unsigned port, unsigned device,
if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD)))
{
bool bind_valid = libretro_input_binds[port] && libretro_input_binds[port][id].valid;
rarch_joypad_info_t joypad_info;
if (bind_valid || device == RETRO_DEVICE_KEYBOARD)
{
rarch_joypad_info_t joypad_info;
joypad_info.axis_threshold = input_driver_axis_threshold;
joypad_info.joy_idx = settings->uints.input_joypad_map[port];
joypad_info.auto_binds = input_autoconf_binds[joypad_info.joy_idx];
@ -691,7 +692,7 @@ int16_t input_state(unsigned port, unsigned device,
#ifdef HAVE_KEYMAPPER
if (input_driver_mapper)
input_mapper_state(input_driver_mapper,
&res, port, device, idx, id, clear);
&res, port, device, idx, id);
#endif
#ifdef HAVE_OVERLAY

View File

@ -47,7 +47,6 @@
#define MAPPER_GET_KEY(state, key) (((state)->keys[(key) / 32] >> ((key) % 32)) & 1)
#define MAPPER_SET_KEY(state, key) (state)->keys[(key) / 32] |= 1 << ((key) % 32)
#define MAPPER_UNSET_KEY(state, key) (state)->keys[(key) / 32] |= 0 << ((key) % 32)
struct input_mapper
{
@ -214,8 +213,7 @@ void input_mapper_state(
unsigned port,
unsigned device,
unsigned idx,
unsigned id,
bool clear)
unsigned id)
{
if (!handle)
return;
@ -223,8 +221,6 @@ void input_mapper_state(
switch (device)
{
case RETRO_DEVICE_JOYPAD:
/* we should get the new buttons here via input_remapper_button_pressed but it doesn't work because the old state is still there
so both actions trigger */
if (input_mapper_button_pressed(handle, id))
*ret = 1;
break;

View File

@ -45,8 +45,7 @@ void input_mapper_state(
unsigned port,
unsigned device,
unsigned idx,
unsigned id,
bool clear);
unsigned id);
RETRO_END_DECLS