Move global->exec to runloop.c as static variable

This commit is contained in:
twinaphex 2015-11-30 15:46:39 +01:00
parent 86de67b3d7
commit b0c36c18dd
3 changed files with 9 additions and 6 deletions

View File

@ -1312,7 +1312,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE)
{
RARCH_LOG("Environ (Private) EXEC_ESCAPE.\n");
global->exec = true;
rarch_main_ctl(RARCH_MAIN_CTL_SET_EXEC, NULL);
}
else
RARCH_LOG("Environ (Private) EXEC.\n");

View File

@ -57,6 +57,7 @@
static struct global g_extern;
static bool main_exec;
static bool main_core_shutdown_initiated;
static bool main_is_idle;
static bool main_is_paused;
@ -796,6 +797,9 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
case RARCH_MAIN_CTL_SET_CORE_SHUTDOWN:
main_core_shutdown_initiated = true;
break;
case RARCH_MAIN_CTL_SET_EXEC:
main_exec = true;
break;
default:
return false;
}
@ -935,12 +939,12 @@ static INLINE int rarch_main_iterate_time_to_exit(event_cmd_state_t *cmd)
video_driver_ctl(RARCH_DISPLAY_CTL_GET_FRAME_COUNT, &frame_count);
frame_count_end = main_max_frames && (*frame_count >= main_max_frames);
if (shutdown_pressed || frame_count_end || movie_end || !video_alive || global->exec)
if (shutdown_pressed || frame_count_end || movie_end || !video_alive || main_exec)
{
settings_t *settings = config_get_ptr();
if (global->exec)
global->exec = false;
if (main_exec)
main_exec = false;
/* Quits out of RetroArch main loop.
* On special case, loads dummy core

View File

@ -56,6 +56,7 @@ enum rarch_main_ctl_state
RARCH_MAIN_CTL_STATE_FREE,
RARCH_MAIN_CTL_GLOBAL_FREE,
RARCH_MAIN_CTL_SET_CORE_SHUTDOWN,
RARCH_MAIN_CTL_SET_EXEC,
/* Checks for state changes in this frame. */
RARCH_MAIN_CTL_CHECK_STATE,
RARCH_MAIN_CTL_CHECK_MOVIE,
@ -200,8 +201,6 @@ typedef struct global
} menu;
#endif
bool exec;
struct
{
/* Rewind support. */