mirror of
https://github.com/libretro/RetroArch
synced 2025-03-21 13:20:52 +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);
|
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
|
/* If core was paused before entering menu, evoke
|
||||||
* pause toggle to wake it up. */
|
* pause toggle to wake it up. */
|
||||||
if (main_is_paused)
|
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;
|
last_input = input;
|
||||||
|
|
||||||
if (driver->flushing_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;
|
trigger_input = input & ~old_input;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user