mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(input_driver.c) Cleanups
This commit is contained in:
parent
a233ce4c87
commit
b94c4eec2b
@ -492,10 +492,10 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2)
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static INLINE bool input_menu_keys_pressed_internal(unsigned i)
|
||||
static INLINE bool input_menu_keys_pressed_internal(unsigned i,
|
||||
unsigned max_users)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned max_users = settings->input.max_users;
|
||||
|
||||
if (
|
||||
(((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY)))
|
||||
@ -581,25 +581,22 @@ uint64_t input_menu_keys_pressed(
|
||||
uint64_t *trigger_input,
|
||||
bool runloop_paused)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned ids[13][2];
|
||||
uint64_t ret = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (current_input && current_input_data)
|
||||
{
|
||||
unsigned i;
|
||||
const struct retro_keybind *binds[MAX_USERS] = {NULL};
|
||||
const struct retro_keybind *binds_norm = NULL;
|
||||
const struct retro_keybind *binds_auto = NULL;
|
||||
|
||||
if (!current_input || !current_input_data)
|
||||
goto end;
|
||||
unsigned max_users = settings->input.max_users;
|
||||
|
||||
if (settings->menu.unified_controls)
|
||||
return input_keys_pressed(
|
||||
old_input,
|
||||
last_input,
|
||||
trigger_input,
|
||||
runloop_paused);
|
||||
return input_keys_pressed(old_input, last_input,
|
||||
trigger_input, runloop_paused);
|
||||
|
||||
for (i = 0; i < settings->input.max_users; i++)
|
||||
for (i = 0; i < max_users; i++)
|
||||
{
|
||||
struct retro_keybind *auto_binds = settings->input.autoconf_binds[i];
|
||||
|
||||
@ -629,18 +626,19 @@ uint64_t input_menu_keys_pressed(
|
||||
|
||||
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||
{
|
||||
if (input_menu_keys_pressed_internal(i))
|
||||
if (input_menu_keys_pressed_internal(i, max_users))
|
||||
ret |= (UINT64_C(1) << i);
|
||||
}
|
||||
|
||||
for (i = 0; i < settings->input.max_users; i++)
|
||||
for (i = 0; i < max_users; i++)
|
||||
{
|
||||
struct retro_keybind *auto_binds = settings->input.autoconf_binds[i];
|
||||
input_pop_analog_dpad(auto_binds);
|
||||
}
|
||||
|
||||
if (menu_input_dialog_get_display_kb())
|
||||
goto end;
|
||||
if (!menu_input_dialog_get_display_kb())
|
||||
{
|
||||
unsigned ids[13][2];
|
||||
|
||||
ids[0][0] = RETROK_SPACE;
|
||||
ids[0][1] = RETRO_DEVICE_ID_JOYPAD_START;
|
||||
@ -681,8 +679,9 @@ uint64_t input_menu_keys_pressed(
|
||||
RETRO_DEVICE_KEYBOARD, 0, ids[i][0]))
|
||||
BIT64_SET(ret, ids[i][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
*trigger_input = ret & ~old_input;
|
||||
*last_input = ret;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user