mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
We can now change menu drivers on the fly
This commit is contained in:
parent
ee8dc151a3
commit
85afd633e4
5
driver.c
5
driver.c
@ -311,7 +311,8 @@ void drivers_init(int flags)
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* By default, we want the menu to persist through driver reinits. */
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL);
|
||||
if (flags & DRIVER_MENU_MASK)
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL);
|
||||
#endif
|
||||
|
||||
if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK))
|
||||
@ -396,7 +397,7 @@ static void uninit_drivers(int flags)
|
||||
core_info_free_current_core();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (flags & DRIVER_MENU_MASK)
|
||||
if (flags & DRIVER_MENU_MASK && !menu_driver_ctl(RARCH_MENU_CTL_OWNS_DRIVER, NULL))
|
||||
menu_driver_ctl(RARCH_MENU_CTL_DEINIT, NULL);
|
||||
#endif
|
||||
|
||||
|
@ -314,25 +314,6 @@ void menu_driver_frame(video_frame_info_t *video_info)
|
||||
menu_driver_ctx->frame(menu_userdata, video_info);
|
||||
}
|
||||
|
||||
/**
|
||||
* menu_update_libretro_info:
|
||||
*
|
||||
* Update menu state which depends on config.
|
||||
**/
|
||||
static void menu_update_libretro_info(void)
|
||||
{
|
||||
struct retro_system_info *info = NULL;
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_GET,
|
||||
&info);
|
||||
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
|
||||
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
}
|
||||
|
||||
bool menu_driver_render(bool is_idle, bool rarch_is_inited,
|
||||
bool rarch_is_dummy_core)
|
||||
{
|
||||
@ -470,9 +451,9 @@ static bool menu_driver_context_reset(bool video_is_threaded)
|
||||
static bool menu_driver_init_internal(bool video_is_threaded)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_update_libretro_info();
|
||||
if (menu_driver_data)
|
||||
return true;
|
||||
|
||||
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
|
||||
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
|
||||
menu_driver_data = (menu_handle_t*)
|
||||
menu_driver_ctx->init(&menu_userdata, video_is_threaded);
|
||||
|
Loading…
x
Reference in New Issue
Block a user