mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-31 08:33:40 +00:00
Refactor away rarch_main_set_pause
This commit is contained in:
parent
0d18c61bc5
commit
4ba88ccabf
@ -1456,16 +1456,21 @@ bool event_command(enum event_command cmd)
|
||||
}
|
||||
break;
|
||||
case EVENT_CMD_PAUSE_TOGGLE:
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_IS_PAUSED, &boolean);
|
||||
rarch_main_set_pause(!boolean);
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_IS_PAUSED, &boolean);
|
||||
boolean = !boolean;
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||
event_command(EVENT_CMD_PAUSE_CHECKS);
|
||||
break;
|
||||
case EVENT_CMD_UNPAUSE:
|
||||
rarch_main_set_pause(false);
|
||||
boolean = false;
|
||||
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||
event_command(EVENT_CMD_PAUSE_CHECKS);
|
||||
break;
|
||||
case EVENT_CMD_PAUSE:
|
||||
rarch_main_set_pause(true);
|
||||
boolean = true;
|
||||
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||
event_command(EVENT_CMD_PAUSE_CHECKS);
|
||||
break;
|
||||
case EVENT_CMD_MENU_PAUSE_LIBRETRO:
|
||||
|
13
runloop.c
13
runloop.c
@ -886,11 +886,6 @@ void rarch_main_set_max_frames(unsigned val)
|
||||
main_max_frames = val;
|
||||
}
|
||||
|
||||
void rarch_main_set_pause(unsigned enable)
|
||||
{
|
||||
main_is_paused = enable;
|
||||
}
|
||||
|
||||
void rarch_main_set_idle(unsigned enable)
|
||||
{
|
||||
main_is_idle = enable;
|
||||
@ -916,6 +911,14 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
|
||||
*ptr = main_is_slowmotion;
|
||||
}
|
||||
return true;
|
||||
case RARCH_MAIN_CTL_SET_PAUSED:
|
||||
{
|
||||
bool *ptr = (bool*)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
main_is_paused = *ptr;
|
||||
}
|
||||
return true;
|
||||
case RARCH_MAIN_CTL_IS_PAUSED:
|
||||
{
|
||||
bool *ptr = (bool*)data;
|
||||
|
@ -38,6 +38,7 @@ enum rarch_main_ctl_state
|
||||
RARCH_MAIN_CTL_IS_IDLE = 0,
|
||||
RARCH_MAIN_CTL_IS_SLOWMOTION,
|
||||
RARCH_MAIN_CTL_IS_PAUSED,
|
||||
RARCH_MAIN_CTL_SET_PAUSED
|
||||
};
|
||||
|
||||
typedef struct rarch_resolution
|
||||
@ -338,8 +339,6 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data);
|
||||
|
||||
void rarch_main_set_slowmotion(unsigned enable);
|
||||
|
||||
void rarch_main_set_pause(unsigned enable);
|
||||
|
||||
void rarch_main_set_frame_limit_last_time(void);
|
||||
|
||||
void rarch_main_set_max_frames(unsigned val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user