mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-31 00:22:31 +00:00
Refactor input_flush
This commit is contained in:
parent
0595393cc0
commit
18af1a74a6
17
runloop.c
17
runloop.c
@ -983,16 +983,16 @@ static void rarch_main_cmd_get_state(driver_t *driver,
|
||||
RARCH_CHEAT_TOGGLE);
|
||||
}
|
||||
|
||||
static bool input_flush(retro_input_t *input)
|
||||
static INLINE bool input_flush(void)
|
||||
{
|
||||
*input = 0;
|
||||
retro_input_t input = 0;
|
||||
|
||||
/* If core was paused before entering menu, evoke
|
||||
* pause toggle to wake it up. */
|
||||
if (main_is_paused)
|
||||
BIT64_SET(*input, RARCH_PAUSE_TOGGLE);
|
||||
BIT64_SET(input, RARCH_PAUSE_TOGGLE);
|
||||
|
||||
return true;
|
||||
return input;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1020,7 +1020,14 @@ int rarch_main_iterate(void)
|
||||
last_input = input;
|
||||
|
||||
if (driver->flushing_input)
|
||||
driver->flushing_input = (input) ? input_flush(&input) : false;
|
||||
{
|
||||
driver->flushing_input = false;
|
||||
if (input)
|
||||
{
|
||||
input = input_flush();
|
||||
driver->flushing_input = true;
|
||||
}
|
||||
}
|
||||
|
||||
trigger_input = input & ~old_input;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user