input_keys_pressed - use bitmasks

This commit is contained in:
twinaphex 2019-08-12 17:48:55 +02:00
parent f117b22a46
commit 95505ae5c5

View File

@ -12377,12 +12377,15 @@ static void input_keys_pressed(input_bits_t *p_new_state)
}
/* Check the libretro input first */
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
{
bool bit_pressed = !input_driver_block_libretro_input && binds[i].valid && current_input->input_state(current_input_data, joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0, i);
if (bit_pressed || input_keys_pressed_other_sources(i, p_new_state))
int16_t ret = current_input->input_state(current_input_data, joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_MASK);
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
{
BIT256_SET_PTR(p_new_state, i);
bool bit_pressed = !input_driver_block_libretro_input && binds[i].valid && (ret & (1 << i));
if (bit_pressed || input_keys_pressed_other_sources(i, p_new_state))
{
BIT256_SET_PTR(p_new_state, i);
}
}
}