mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Cleanups
This commit is contained in:
parent
9bde8ca3e5
commit
9b4c50a017
81
retroarch.c
81
retroarch.c
@ -19264,28 +19264,26 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RARCH_CTL_CORE_OPTIONS_DEINIT:
|
case RARCH_CTL_CORE_OPTIONS_DEINIT:
|
||||||
|
if (!runloop_core_options)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* check if game options file was just created and flush
|
||||||
|
to that file instead */
|
||||||
|
if (!path_is_empty(RARCH_PATH_CORE_OPTIONS))
|
||||||
{
|
{
|
||||||
if (!runloop_core_options)
|
core_option_manager_flush_game_specific(runloop_core_options,
|
||||||
return false;
|
path_get(RARCH_PATH_CORE_OPTIONS));
|
||||||
|
path_clear(RARCH_PATH_CORE_OPTIONS);
|
||||||
/* check if game options file was just created and flush
|
|
||||||
to that file instead */
|
|
||||||
if (!path_is_empty(RARCH_PATH_CORE_OPTIONS))
|
|
||||||
{
|
|
||||||
core_option_manager_flush_game_specific(runloop_core_options,
|
|
||||||
path_get(RARCH_PATH_CORE_OPTIONS));
|
|
||||||
path_clear(RARCH_PATH_CORE_OPTIONS);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
core_option_manager_flush(runloop_core_options);
|
|
||||||
|
|
||||||
if (runloop_game_options_active)
|
|
||||||
runloop_game_options_active = false;
|
|
||||||
|
|
||||||
if (runloop_core_options)
|
|
||||||
core_option_manager_free(runloop_core_options);
|
|
||||||
runloop_core_options = NULL;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
core_option_manager_flush(runloop_core_options);
|
||||||
|
|
||||||
|
if (runloop_game_options_active)
|
||||||
|
runloop_game_options_active = false;
|
||||||
|
|
||||||
|
if (runloop_core_options)
|
||||||
|
core_option_manager_free(runloop_core_options);
|
||||||
|
runloop_core_options = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RARCH_CTL_CORE_OPTIONS_DISPLAY:
|
case RARCH_CTL_CORE_OPTIONS_DISPLAY:
|
||||||
@ -19783,15 +19781,6 @@ void runloop_get_status(bool *is_paused, bool *is_idle,
|
|||||||
*/
|
*/
|
||||||
#define TIME_TO_EXIT(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !is_alive || BSV_MOVIE_IS_EOF() || ((runloop_max_frames != 0) && (frame_count >= runloop_max_frames)) || runloop_exec)
|
#define TIME_TO_EXIT(quit_key_pressed) (runloop_shutdown_initiated || quit_key_pressed || !is_alive || BSV_MOVIE_IS_EOF() || ((runloop_max_frames != 0) && (frame_count >= runloop_max_frames)) || runloop_exec)
|
||||||
|
|
||||||
#define RUNLOOP_CHECK_CHEEVOS() (settings->bools.cheevos_enable && rcheevos_loaded && (!rcheevos_cheats_are_enabled && !rcheevos_cheats_were_enabled))
|
|
||||||
|
|
||||||
#ifdef HAVE_NETWORKING
|
|
||||||
/* FIXME: This is an ugly way to tell Netplay this... */
|
|
||||||
#define RUNLOOP_NETPLAY_PAUSE() netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL)
|
|
||||||
#else
|
|
||||||
#define RUNLOOP_NETPLAY_PAUSE() ((void)0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
static bool input_driver_toggle_button_combo(
|
static bool input_driver_toggle_button_combo(
|
||||||
unsigned mode, input_bits_t* p_input)
|
unsigned mode, input_bits_t* p_input)
|
||||||
@ -20697,10 +20686,13 @@ static enum runloop_state runloop_check_state(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a file is modified atomically (moved/renamed from a different file), we have no idea how long that might take.
|
/* If a file is modified atomically (moved/renamed from a different file),
|
||||||
* If we're trying to re-apply shaders immediately after changes are made to the original file(s), the filesystem might be in an in-between
|
* we have no idea how long that might take.
|
||||||
* state where the new file hasn't been moved over yet and the original file was already deleted. This leaves us no choice
|
* If we're trying to re-apply shaders immediately after changes are made
|
||||||
* but to wait an arbitrary amount of time and hope for the best.
|
* to the original file(s), the filesystem might be in an in-between
|
||||||
|
* state where the new file hasn't been moved over yet and the original
|
||||||
|
* file was already deleted. This leaves us no choice but to wait an
|
||||||
|
* arbitrary amount of time and hope for the best.
|
||||||
*/
|
*/
|
||||||
if (need_to_apply)
|
if (need_to_apply)
|
||||||
{
|
{
|
||||||
@ -20810,21 +20802,27 @@ int runloop_iterate(unsigned *sleep_ms)
|
|||||||
command_event(CMD_EVENT_QUIT, NULL);
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
return -1;
|
return -1;
|
||||||
case RUNLOOP_STATE_POLLED_AND_SLEEP:
|
case RUNLOOP_STATE_POLLED_AND_SLEEP:
|
||||||
RUNLOOP_NETPLAY_PAUSE();
|
#ifdef HAVE_NETWORKING
|
||||||
|
/* FIXME: This is an ugly way to tell Netplay this... */
|
||||||
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL);
|
||||||
|
#endif
|
||||||
*sleep_ms = 10;
|
*sleep_ms = 10;
|
||||||
return 1;
|
return 1;
|
||||||
case RUNLOOP_STATE_END:
|
case RUNLOOP_STATE_END:
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)
|
/* FIXME: This is an ugly way to tell Netplay this... */
|
||||||
&& settings->bools.menu_pause_libretro)
|
if (settings->bools.menu_pause_libretro &&
|
||||||
RUNLOOP_NETPLAY_PAUSE();
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)
|
||||||
|
)
|
||||||
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL);
|
||||||
#endif
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
case RUNLOOP_STATE_MENU_ITERATE:
|
case RUNLOOP_STATE_MENU_ITERATE:
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
RUNLOOP_NETPLAY_PAUSE();
|
/* FIXME: This is an ugly way to tell Netplay this... */
|
||||||
return 0;
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
return 0;
|
||||||
case RUNLOOP_STATE_ITERATE:
|
case RUNLOOP_STATE_ITERATE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -20884,7 +20882,10 @@ int runloop_iterate(unsigned *sleep_ms)
|
|||||||
rarch_core_runtime_tick();
|
rarch_core_runtime_tick();
|
||||||
|
|
||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
if (RUNLOOP_CHECK_CHEEVOS())
|
if ( settings->bools.cheevos_enable &&
|
||||||
|
rcheevos_loaded &&
|
||||||
|
(!rcheevos_cheats_are_enabled && !rcheevos_cheats_were_enabled)
|
||||||
|
)
|
||||||
rcheevos_test();
|
rcheevos_test();
|
||||||
#endif
|
#endif
|
||||||
cheat_manager_apply_retro_cheats();
|
cheat_manager_apply_retro_cheats();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user