mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 19:21:03 +00:00
rarch_main_command actually does the pause toggling now
This commit is contained in:
parent
918e9efd4a
commit
8db19cd5ef
@ -131,6 +131,9 @@ enum basic_event
|
||||
RARCH_CMD_QUIT_RETROARCH,
|
||||
RARCH_CMD_RESUME,
|
||||
RARCH_CMD_PAUSE_TOGGLE,
|
||||
RARCH_CMD_UNPAUSE,
|
||||
RARCH_CMD_PAUSE,
|
||||
RARCH_CMD_PAUSE_CHECKS,
|
||||
RARCH_CMD_MENU_SAVE_CONFIG,
|
||||
RARCH_CMD_MENU_PAUSE_LIBRETRO,
|
||||
RARCH_CMD_SHADERS_APPLY_CHANGES,
|
||||
|
14
retroarch.c
14
retroarch.c
@ -2504,7 +2504,7 @@ bool rarch_main_command(unsigned cmd)
|
||||
menu_shader_manager_apply_changes();
|
||||
#endif
|
||||
break;
|
||||
case RARCH_CMD_PAUSE_TOGGLE:
|
||||
case RARCH_CMD_PAUSE_CHECKS:
|
||||
if (g_extern.is_paused)
|
||||
{
|
||||
RARCH_LOG("Paused.\n");
|
||||
@ -2519,6 +2519,18 @@ bool rarch_main_command(unsigned cmd)
|
||||
rarch_main_command(RARCH_CMD_AUDIO_START);
|
||||
}
|
||||
break;
|
||||
case RARCH_CMD_PAUSE_TOGGLE:
|
||||
g_extern.is_paused = !g_extern.is_paused;
|
||||
rarch_main_command(RARCH_CMD_PAUSE_CHECKS);
|
||||
break;
|
||||
case RARCH_CMD_UNPAUSE:
|
||||
g_extern.is_paused = false;
|
||||
rarch_main_command(RARCH_CMD_PAUSE_CHECKS);
|
||||
break;
|
||||
case RARCH_CMD_PAUSE:
|
||||
g_extern.is_paused = true;
|
||||
rarch_main_command(RARCH_CMD_PAUSE_CHECKS);
|
||||
break;
|
||||
case RARCH_CMD_MENU_PAUSE_LIBRETRO:
|
||||
if (g_extern.is_menu)
|
||||
{
|
||||
|
15
runloop.c
15
runloop.c
@ -50,6 +50,7 @@ static bool check_pause(bool pressed, bool frameadvance_pressed)
|
||||
static bool old_focus = true;
|
||||
bool focus = true;
|
||||
bool old_is_paused = g_extern.is_paused;
|
||||
unsigned cmd = RARCH_CMD_NONE;
|
||||
|
||||
/* FRAMEADVANCE will set us into pause mode. */
|
||||
pressed |= !g_extern.is_paused && frameadvance_pressed;
|
||||
@ -58,17 +59,20 @@ static bool check_pause(bool pressed, bool frameadvance_pressed)
|
||||
focus = driver.video->focus(driver.video_data);
|
||||
|
||||
if (focus && pressed)
|
||||
g_extern.is_paused = !g_extern.is_paused;
|
||||
cmd = RARCH_CMD_PAUSE_TOGGLE;
|
||||
else if (focus && !old_focus)
|
||||
g_extern.is_paused = false;
|
||||
cmd = RARCH_CMD_UNPAUSE;
|
||||
else if (!focus && old_focus)
|
||||
g_extern.is_paused = true;
|
||||
cmd = RARCH_CMD_PAUSE;
|
||||
|
||||
old_focus = focus;
|
||||
|
||||
if (cmd != RARCH_CMD_NONE)
|
||||
rarch_main_command(cmd);
|
||||
|
||||
if (g_extern.is_paused == old_is_paused)
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -398,8 +402,7 @@ static int do_state_checks(
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
if (check_pause_func(trigger_input))
|
||||
rarch_main_command(RARCH_CMD_PAUSE_TOGGLE);
|
||||
check_pause_func(trigger_input);
|
||||
|
||||
if (g_extern.is_paused)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user