mirror of
https://github.com/libretro/RetroArch
synced 2025-02-12 00:40:26 +00:00
input_keys_pressed - start splitting up big for loop into
optimized smaller parts
This commit is contained in:
parent
4d002ec682
commit
a564ac0701
@ -617,6 +617,7 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2)
|
|||||||
retro_input_t input_keys_pressed(void)
|
retro_input_t input_keys_pressed(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
bool states[RARCH_BIND_LIST_END];
|
||||||
retro_input_t ret;
|
retro_input_t ret;
|
||||||
|
|
||||||
ret.type = 0;
|
ret.type = 0;
|
||||||
@ -632,38 +633,50 @@ retro_input_t input_keys_pressed(void)
|
|||||||
else
|
else
|
||||||
input_driver_block_libretro_input = false;
|
input_driver_block_libretro_input = false;
|
||||||
|
|
||||||
|
if (current_input->key_pressed)
|
||||||
|
{
|
||||||
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||||
{
|
{
|
||||||
bool state = false;
|
if ((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY)))
|
||||||
if (((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY)))
|
|| !input_driver_block_hotkey)
|
||||||
|| !input_driver_block_hotkey) && current_input->key_pressed)
|
states[i] = current_input->key_pressed(current_input_data, i);
|
||||||
state = current_input->key_pressed(current_input_data, i);
|
}
|
||||||
|
}
|
||||||
if (i >= RARCH_FIRST_META_KEY)
|
|
||||||
state |= current_input->meta_key_pressed(current_input_data, i);
|
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
state |= input_overlay_key_pressed(i);
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||||
|
states[i] |= input_overlay_key_pressed(i);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COMMAND
|
#ifdef HAVE_COMMAND
|
||||||
if (input_driver_command)
|
if (input_driver_command)
|
||||||
|
{
|
||||||
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||||
{
|
{
|
||||||
command_handle_t handle;
|
command_handle_t handle;
|
||||||
|
|
||||||
handle.handle = input_driver_command;
|
handle.handle = input_driver_command;
|
||||||
handle.id = i;
|
handle.id = i;
|
||||||
|
|
||||||
state |= command_get(&handle);
|
states[i] |= command_get(&handle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NETWORKGAMEPAD
|
#ifdef HAVE_NETWORKGAMEPAD
|
||||||
if (input_driver_remote)
|
if (input_driver_remote)
|
||||||
state |= input_remote_key_pressed(i, 0);
|
{
|
||||||
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||||
|
states[i] |= input_remote_key_pressed(i, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (state)
|
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
||||||
|
states[i] |= current_input->meta_key_pressed(current_input_data, i);
|
||||||
|
|
||||||
|
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||||
|
{
|
||||||
|
if (states[i])
|
||||||
ret.state |= (UINT64_C(1) << i);
|
ret.state |= (UINT64_C(1) << i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user