mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Create video_driver_restore_cached
This commit is contained in:
parent
c9997ce520
commit
451a49f6a1
37
retroarch.c
37
retroarch.c
@ -2940,6 +2940,9 @@ static void menu_input_post_iterate(
|
|||||||
static void menu_input_reset(struct rarch_state *p_rarch);
|
static void menu_input_reset(struct rarch_state *p_rarch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void video_driver_restore_cached(struct rarch_state *p_rarch,
|
||||||
|
settings_t *settings);
|
||||||
|
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
struct netplay_room* netplay_get_host_room(void)
|
struct netplay_room* netplay_get_host_room(void)
|
||||||
{
|
{
|
||||||
@ -16233,15 +16236,7 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
retroarch_unset_runtime_shader_preset(p_rarch);
|
retroarch_unset_runtime_shader_preset(p_rarch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (p_rarch->cached_video_driver[0])
|
video_driver_restore_cached(p_rarch, settings);
|
||||||
{
|
|
||||||
configuration_set_string(settings,
|
|
||||||
settings->arrays.video_driver, p_rarch->cached_video_driver);
|
|
||||||
|
|
||||||
p_rarch->cached_video_driver[0] = 0;
|
|
||||||
RARCH_LOG("[Video]: Restored video driver to \"%s\".\n",
|
|
||||||
settings->arrays.video_driver);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIGFILE
|
#ifdef HAVE_CONFIGFILE
|
||||||
if ( p_rarch->runloop_remaps_core_active
|
if ( p_rarch->runloop_remaps_core_active
|
||||||
@ -17670,15 +17665,7 @@ void main_exit(void *args)
|
|||||||
settings_t *settings = p_rarch->configuration_settings;
|
settings_t *settings = p_rarch->configuration_settings;
|
||||||
bool config_save_on_exit = settings->bools.config_save_on_exit;
|
bool config_save_on_exit = settings->bools.config_save_on_exit;
|
||||||
|
|
||||||
if (p_rarch->cached_video_driver[0])
|
video_driver_restore_cached(p_rarch, settings);
|
||||||
{
|
|
||||||
configuration_set_string(settings,
|
|
||||||
settings->arrays.video_driver, p_rarch->cached_video_driver);
|
|
||||||
|
|
||||||
p_rarch->cached_video_driver[0] = 0;
|
|
||||||
RARCH_LOG("[Video]: Restored video driver to \"%s\".\n",
|
|
||||||
settings->arrays.video_driver);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config_save_on_exit)
|
if (config_save_on_exit)
|
||||||
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
||||||
@ -33367,6 +33354,20 @@ static void video_driver_save_as_cached(struct rarch_state *p_rarch,
|
|||||||
rdr_context_name);
|
rdr_context_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void video_driver_restore_cached(struct rarch_state *p_rarch,
|
||||||
|
settings_t *settings)
|
||||||
|
{
|
||||||
|
if (p_rarch->cached_video_driver[0])
|
||||||
|
{
|
||||||
|
configuration_set_string(settings,
|
||||||
|
settings->arrays.video_driver, p_rarch->cached_video_driver);
|
||||||
|
|
||||||
|
p_rarch->cached_video_driver[0] = 0;
|
||||||
|
RARCH_LOG("[Video]: Restored video driver to \"%s\".\n",
|
||||||
|
settings->arrays.video_driver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool video_driver_find_driver(struct rarch_state *p_rarch)
|
static bool video_driver_find_driver(struct rarch_state *p_rarch)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user