mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
Rearrange some code
This commit is contained in:
parent
ef548ba25e
commit
bef9a8d9d6
34
runloop.c
34
runloop.c
@ -406,7 +406,7 @@ static bool rarch_game_specific_options(char **output)
|
|||||||
static bool runloop_is_focused(void)
|
static bool runloop_is_focused(void)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
if (settings->pause_nonactive)
|
if (settings && settings->pause_nonactive)
|
||||||
return video_driver_is_focused();
|
return video_driver_is_focused();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -920,7 +920,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
char buf[PATH_MAX_LENGTH] = {0};
|
char buf[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char *options_path = settings->path.core_options;
|
const char *options_path = settings ? settings->path.core_options : NULL;
|
||||||
const struct retro_variable *vars =
|
const struct retro_variable *vars =
|
||||||
(const struct retro_variable*)data;
|
(const struct retro_variable*)data;
|
||||||
|
|
||||||
@ -931,8 +931,7 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
|||||||
options_path = buf;
|
options_path = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings && settings->game_specific_options)
|
||||||
if (settings->game_specific_options)
|
|
||||||
ret = rarch_game_specific_options(&game_options_path);
|
ret = rarch_game_specific_options(&game_options_path);
|
||||||
|
|
||||||
if(ret)
|
if(ret)
|
||||||
@ -1089,7 +1088,6 @@ void runloop_set_quit_confirm(bool on)
|
|||||||
*/
|
*/
|
||||||
static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed)
|
static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
bool time_to_exit = runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL);
|
bool time_to_exit = runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL);
|
||||||
time_to_exit = time_to_exit || quit_key_pressed;
|
time_to_exit = time_to_exit || quit_key_pressed;
|
||||||
time_to_exit = time_to_exit || !video_driver_is_alive();
|
time_to_exit = time_to_exit || !video_driver_is_alive();
|
||||||
@ -1101,21 +1099,25 @@ static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
if (settings && settings->confirm_on_exit &&
|
if (!runloop_is_quit_confirm())
|
||||||
!runloop_quit_confirm)
|
|
||||||
{
|
{
|
||||||
if (menu_dialog_is_active())
|
settings_t *settings = config_get_ptr();
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (content_is_inited())
|
if (settings && settings->confirm_on_exit)
|
||||||
{
|
{
|
||||||
if(menu_display_toggle_get_reason() != MENU_TOGGLE_REASON_USER)
|
if (menu_dialog_is_active())
|
||||||
menu_display_toggle_set_reason(MENU_TOGGLE_REASON_MESSAGE);
|
return 1;
|
||||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT);
|
if (content_is_inited())
|
||||||
return 1;
|
{
|
||||||
|
if(menu_display_toggle_get_reason() != MENU_TOGGLE_REASON_USER)
|
||||||
|
menu_display_toggle_set_reason(MENU_TOGGLE_REASON_MESSAGE);
|
||||||
|
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user