mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Simplify runloop_check_state
This commit is contained in:
parent
c6ae8a527c
commit
34f0a4f49f
41
runloop.c
41
runloop.c
@ -256,28 +256,6 @@ static bool rarch_game_specific_options(char **output)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool runloop_check_pause_state(event_cmd_state_t *cmd)
|
||||
{
|
||||
bool check_is_oneshot = runloop_cmd_triggered(cmd,
|
||||
RARCH_FRAMEADVANCE)
|
||||
|| runloop_cmd_press(cmd, RARCH_REWIND);
|
||||
|
||||
if (!runloop_paused)
|
||||
return true;
|
||||
|
||||
if (runloop_cmd_triggered(cmd, RARCH_FULLSCREEN_TOGGLE_KEY))
|
||||
{
|
||||
command_event(CMD_EVENT_FULLSCREEN_TOGGLE, NULL);
|
||||
video_driver_cached_frame_render();
|
||||
}
|
||||
|
||||
if (!check_is_oneshot)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool runloop_check_state(event_cmd_state_t *cmd)
|
||||
{
|
||||
static bool old_focus = true;
|
||||
@ -337,9 +315,26 @@ static bool runloop_check_state(event_cmd_state_t *cmd)
|
||||
|
||||
old_focus = focused;
|
||||
|
||||
if (!runloop_check_pause_state(cmd) || !focused)
|
||||
if (!focused)
|
||||
return false;
|
||||
|
||||
if (runloop_paused)
|
||||
{
|
||||
/* check pause state */
|
||||
|
||||
bool check_is_oneshot = runloop_cmd_triggered(cmd,
|
||||
RARCH_FRAMEADVANCE)
|
||||
|| runloop_cmd_press(cmd, RARCH_REWIND);
|
||||
if (runloop_cmd_triggered(cmd, RARCH_FULLSCREEN_TOGGLE_KEY))
|
||||
{
|
||||
command_event(CMD_EVENT_FULLSCREEN_TOGGLE, NULL);
|
||||
video_driver_cached_frame_render();
|
||||
}
|
||||
|
||||
if (!check_is_oneshot)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* To avoid continous switching if we hold the button down, we require
|
||||
* that the button must go from pressed to unpressed back to pressed
|
||||
* to be able to toggle between then.
|
||||
|
Loading…
x
Reference in New Issue
Block a user