mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +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_QUIT_RETROARCH,
|
||||||
RARCH_CMD_RESUME,
|
RARCH_CMD_RESUME,
|
||||||
RARCH_CMD_PAUSE_TOGGLE,
|
RARCH_CMD_PAUSE_TOGGLE,
|
||||||
|
RARCH_CMD_UNPAUSE,
|
||||||
|
RARCH_CMD_PAUSE,
|
||||||
|
RARCH_CMD_PAUSE_CHECKS,
|
||||||
RARCH_CMD_MENU_SAVE_CONFIG,
|
RARCH_CMD_MENU_SAVE_CONFIG,
|
||||||
RARCH_CMD_MENU_PAUSE_LIBRETRO,
|
RARCH_CMD_MENU_PAUSE_LIBRETRO,
|
||||||
RARCH_CMD_SHADERS_APPLY_CHANGES,
|
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();
|
menu_shader_manager_apply_changes();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case RARCH_CMD_PAUSE_TOGGLE:
|
case RARCH_CMD_PAUSE_CHECKS:
|
||||||
if (g_extern.is_paused)
|
if (g_extern.is_paused)
|
||||||
{
|
{
|
||||||
RARCH_LOG("Paused.\n");
|
RARCH_LOG("Paused.\n");
|
||||||
@ -2519,6 +2519,18 @@ bool rarch_main_command(unsigned cmd)
|
|||||||
rarch_main_command(RARCH_CMD_AUDIO_START);
|
rarch_main_command(RARCH_CMD_AUDIO_START);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case RARCH_CMD_MENU_PAUSE_LIBRETRO:
|
||||||
if (g_extern.is_menu)
|
if (g_extern.is_menu)
|
||||||
{
|
{
|
||||||
|
13
runloop.c
13
runloop.c
@ -50,6 +50,7 @@ static bool check_pause(bool pressed, bool frameadvance_pressed)
|
|||||||
static bool old_focus = true;
|
static bool old_focus = true;
|
||||||
bool focus = true;
|
bool focus = true;
|
||||||
bool old_is_paused = g_extern.is_paused;
|
bool old_is_paused = g_extern.is_paused;
|
||||||
|
unsigned cmd = RARCH_CMD_NONE;
|
||||||
|
|
||||||
/* FRAMEADVANCE will set us into pause mode. */
|
/* FRAMEADVANCE will set us into pause mode. */
|
||||||
pressed |= !g_extern.is_paused && frameadvance_pressed;
|
pressed |= !g_extern.is_paused && frameadvance_pressed;
|
||||||
@ -58,14 +59,17 @@ static bool check_pause(bool pressed, bool frameadvance_pressed)
|
|||||||
focus = driver.video->focus(driver.video_data);
|
focus = driver.video->focus(driver.video_data);
|
||||||
|
|
||||||
if (focus && pressed)
|
if (focus && pressed)
|
||||||
g_extern.is_paused = !g_extern.is_paused;
|
cmd = RARCH_CMD_PAUSE_TOGGLE;
|
||||||
else if (focus && !old_focus)
|
else if (focus && !old_focus)
|
||||||
g_extern.is_paused = false;
|
cmd = RARCH_CMD_UNPAUSE;
|
||||||
else if (!focus && old_focus)
|
else if (!focus && old_focus)
|
||||||
g_extern.is_paused = true;
|
cmd = RARCH_CMD_PAUSE;
|
||||||
|
|
||||||
old_focus = focus;
|
old_focus = focus;
|
||||||
|
|
||||||
|
if (cmd != RARCH_CMD_NONE)
|
||||||
|
rarch_main_command(cmd);
|
||||||
|
|
||||||
if (g_extern.is_paused == old_is_paused)
|
if (g_extern.is_paused == old_is_paused)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -398,8 +402,7 @@ static int do_state_checks(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (check_pause_func(trigger_input))
|
check_pause_func(trigger_input);
|
||||||
rarch_main_command(RARCH_CMD_PAUSE_TOGGLE);
|
|
||||||
|
|
||||||
if (g_extern.is_paused)
|
if (g_extern.is_paused)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user