Add update_core_info function callback to menu display layer

This commit is contained in:
twinaphex 2014-11-25 03:49:26 +01:00
parent 3c6a67a146
commit c89b91b174
10 changed files with 56 additions and 4 deletions

View File

@ -434,6 +434,12 @@ static void glui_init_core_info(void *data)
} }
} }
static void glui_update_core_info(void *data)
{
(void)data;
menu_update_libretro_info(&g_extern.menu.info);
}
static void *glui_init(void) static void *glui_init(void)
{ {
menu_handle_t *menu; menu_handle_t *menu;
@ -619,6 +625,7 @@ menu_ctx_driver_t menu_ctx_glui = {
NULL, NULL,
NULL, NULL,
glui_init_core_info, glui_init_core_info,
glui_update_core_info,
&menu_ctx_backend_common, &menu_ctx_backend_common,
"glui", "glui",
}; };

View File

@ -61,6 +61,12 @@ static int menu_ios_iterate(unsigned action)
return 0; return 0;
} }
static void ios_update_core_info(void *data)
{
(void)data;
menu_update_libretro_info(&g_extern.menu.info);
}
menu_ctx_driver_backend_t menu_ctx_backend_ios = { menu_ctx_driver_backend_t menu_ctx_backend_ios = {
menu_ios_iterate, menu_ios_iterate,
@ -92,6 +98,7 @@ menu_ctx_driver_t menu_ctx_ios = {
NULL, // list_clear NULL, // list_clear
NULL, // list_set_selection NULL, // list_set_selection
NULL, // init_core_info NULL, // init_core_info
ios_update_core_info, // ios_update_core_info
&menu_ctx_backend_ios, // backend &menu_ctx_backend_ios, // backend
"ios", "ios",
}; };

View File

@ -1172,6 +1172,12 @@ static void lakka_init_core_info(void *data)
g_extern.core_info = core_info_list_new(g_settings.libretro_directory); g_extern.core_info = core_info_list_new(g_settings.libretro_directory);
} }
static void lakka_update_core_info(void *data)
{
(void)data;
menu_update_libretro_info(&g_extern.menu.info);
}
static void *lakka_init(void) static void *lakka_init(void)
{ {
menu_handle_t *menu = NULL; menu_handle_t *menu = NULL;
@ -1333,6 +1339,7 @@ menu_ctx_driver_t menu_ctx_lakka = {
NULL, NULL,
NULL, NULL,
lakka_init_core_info, lakka_init_core_info,
lakka_update_core_info,
&menu_ctx_backend_lakka, &menu_ctx_backend_lakka,
"lakka", "lakka",
}; };

View File

@ -32,6 +32,7 @@ typedef struct menu_ctx_driver
void (*list_clear)(void *); void (*list_clear)(void *);
void (*list_set_selection)(void *); void (*list_set_selection)(void *);
void (*init_core_info)(void *); void (*init_core_info)(void *);
void (*update_core_info)(void *);
const menu_ctx_driver_backend_t *backend; const menu_ctx_driver_backend_t *backend;
const char *ident; const char *ident;

View File

@ -563,6 +563,12 @@ static void rgui_navigation_set(void *data, bool scroll)
- RGUI_TERM_HEIGHT; - RGUI_TERM_HEIGHT;
} }
static void rgui_update_core_info(void *data)
{
(void)data;
menu_update_libretro_info(&g_extern.menu.info);
}
menu_ctx_driver_t menu_ctx_rgui = { menu_ctx_driver_t menu_ctx_rgui = {
rgui_set_texture, rgui_set_texture,
rgui_render_messagebox, rgui_render_messagebox,
@ -588,6 +594,7 @@ menu_ctx_driver_t menu_ctx_rgui = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
rgui_update_core_info,
&menu_ctx_backend_common, &menu_ctx_backend_common,
"rgui", "rgui",
}; };

View File

@ -322,6 +322,12 @@ static void rmenu_free(void *data)
{ {
} }
static void rmenu_update_core_info(void *data)
{
(void)data;
menu_update_libretro_info(&g_extern.menu.info);
}
menu_ctx_driver_t menu_ctx_rmenu = { menu_ctx_driver_t menu_ctx_rmenu = {
rmenu_set_texture, rmenu_set_texture,
rmenu_render_messagebox, rmenu_render_messagebox,
@ -347,6 +353,7 @@ menu_ctx_driver_t menu_ctx_rmenu = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
rmenu_update_core_info,
&menu_ctx_backend_common, &menu_ctx_backend_common,
"rmenu", "rmenu",
}; };

View File

@ -520,6 +520,12 @@ static void rmenu_xui_list_set_selection(void *data)
XuiListSetCurSel(m_menulist, file_list_get_directory_ptr(list)); XuiListSetCurSel(m_menulist, file_list_get_directory_ptr(list));
} }
static void rmenu_xui_update_core_info(void *data)
{
(void)data;
update_libretro_info(&g_extern.menu.info);
}
menu_ctx_driver_t menu_ctx_rmenu_xui = { menu_ctx_driver_t menu_ctx_rmenu_xui = {
NULL, NULL,
rmenu_xui_render_messagebox, rmenu_xui_render_messagebox,
@ -545,6 +551,7 @@ menu_ctx_driver_t menu_ctx_rmenu_xui = {
rmenu_xui_list_clear, rmenu_xui_list_clear,
rmenu_xui_list_set_selection, rmenu_xui_list_set_selection,
NULL, NULL,
rmenu_xui_update_core_info,
&menu_ctx_backend_common, &menu_ctx_backend_common,
"rmenu_xui", "rmenu_xui",
}; };

View File

@ -999,6 +999,11 @@ static void xmb_init_core_info(void *data)
} }
} }
static void xmb_update_core_info(void *data)
{
(void)data;
}
static void *xmb_init(void) static void *xmb_init(void)
{ {
menu_handle_t *menu = NULL; menu_handle_t *menu = NULL;
@ -1416,6 +1421,7 @@ menu_ctx_driver_t menu_ctx_xmb = {
xmb_list_clear, xmb_list_clear,
xmb_list_set_selection, xmb_list_set_selection,
xmb_init_core_info, xmb_init_core_info,
xmb_update_core_info,
&menu_ctx_backend_common, &menu_ctx_backend_common,
"xmb", "xmb",
}; };

View File

@ -47,7 +47,7 @@ static void draw_frame(void)
/* Update menu state which depends on config. */ /* Update menu state which depends on config. */
static void update_libretro_info(struct retro_system_info *info) void menu_update_libretro_info(struct retro_system_info *info)
{ {
#ifndef HAVE_DYNAMIC #ifndef HAVE_DYNAMIC
retro_get_system_info(info); retro_get_system_info(info);
@ -132,8 +132,9 @@ bool load_menu_content(void)
return false; return false;
} }
if (driver.menu) if (driver.menu && driver.menu_ctx
update_libretro_info(&g_extern.menu.info); && driver.menu_ctx->update_core_info)
driver.menu_ctx->update_core_info(driver.menu);
menu_shader_manager_init(driver.menu); menu_shader_manager_init(driver.menu);
@ -168,7 +169,7 @@ void *menu_init(const void *data)
menu->push_start_screen = g_settings.menu_show_start_screen; menu->push_start_screen = g_settings.menu_show_start_screen;
g_settings.menu_show_start_screen = false; g_settings.menu_show_start_screen = false;
update_libretro_info(&g_extern.menu.info); menu_update_libretro_info(&g_extern.menu.info);
menu_shader_manager_init(menu); menu_shader_manager_init(menu);

View File

@ -155,6 +155,8 @@ bool load_menu_content(void);
void menu_update_system_info(menu_handle_t *menu, bool *load_no_content); void menu_update_system_info(menu_handle_t *menu, bool *load_no_content);
void menu_update_libretro_info(struct retro_system_info *info);
unsigned menu_common_type_is(const char *label, unsigned type); unsigned menu_common_type_is(const char *label, unsigned type);
void apply_deferred_settings(void); void apply_deferred_settings(void);