Move menu_update_libretro_info to menu_driver.c

This commit is contained in:
twinaphex 2016-08-17 12:51:26 +02:00
parent f26044678d
commit ff07d3569b
2 changed files with 20 additions and 23 deletions

View File

@ -270,27 +270,6 @@ static bool driver_update_system_av_info(const struct retro_system_av_info *info
return true;
}
#ifdef HAVE_MENU
/**
* 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);
}
#endif
/**
* init_drivers:
* @flags : Bitmask of drivers to initialize.
@ -350,8 +329,6 @@ static void init_drivers(int flags)
init_location();
#ifdef HAVE_MENU
menu_update_libretro_info();
if (flags & DRIVER_MENU)
{
menu_driver_ctl(RARCH_MENU_CTL_INIT, NULL);

View File

@ -283,6 +283,25 @@ const char *menu_driver_ident(void)
return menu_driver_ctx->ident;
}
/**
* 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_ctl(enum rarch_menu_ctl_state state, void *data)
{
switch (state)
@ -555,6 +574,7 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
case RARCH_MENU_CTL_INIT:
{
settings_t *settings = config_get_ptr();
menu_update_libretro_info();
if (menu_driver_data)
return true;