mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-26 21:36:26 +00:00
Merge pull request #1391 from lakkatv/xmb
(Menu) No more core_info manipulation on the menu driver side. Instead, ...
This commit is contained in:
commit
73aa0ff177
@ -453,23 +453,6 @@ static void glui_frame(void)
|
||||
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
|
||||
}
|
||||
|
||||
static void glui_init_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
core_info_list_free(g_extern.core_info);
|
||||
g_extern.core_info = NULL;
|
||||
|
||||
if (*g_settings.libretro_directory)
|
||||
g_extern.core_info = core_info_list_new(g_settings.libretro_directory);
|
||||
}
|
||||
|
||||
static void glui_update_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
}
|
||||
|
||||
static void *glui_init(void)
|
||||
{
|
||||
menu_handle_t *menu;
|
||||
@ -496,8 +479,6 @@ static void *glui_init(void)
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
glui->bg = 0;
|
||||
|
||||
glui_init_core_info(menu);
|
||||
|
||||
return menu;
|
||||
error:
|
||||
if (menu)
|
||||
@ -514,10 +495,6 @@ static void glui_free(void *data)
|
||||
|
||||
if (menu->userdata)
|
||||
free(menu->userdata);
|
||||
|
||||
if (g_extern.core_info)
|
||||
core_info_list_free(g_extern.core_info);
|
||||
g_extern.core_info = NULL;
|
||||
}
|
||||
|
||||
static GLuint glui_png_texture_load_(const char * file_name)
|
||||
@ -673,8 +650,6 @@ menu_ctx_driver_t menu_ctx_glui = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
glui_init_core_info,
|
||||
glui_update_core_info,
|
||||
glui_entry_iterate,
|
||||
"glui",
|
||||
};
|
||||
|
@ -89,13 +89,6 @@ static void ios_free(void *data)
|
||||
free(menu);
|
||||
}
|
||||
|
||||
|
||||
static void ios_update_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_ios = {
|
||||
NULL, // set_texture
|
||||
NULL, // render_messagebox
|
||||
@ -122,8 +115,6 @@ menu_ctx_driver_t menu_ctx_ios = {
|
||||
NULL, // list_clear
|
||||
NULL, // list_cache
|
||||
NULL, // list_set_selection
|
||||
NULL, // init_core_info
|
||||
ios_update_core_info, // ios_update_core_info
|
||||
ios_entry_iterate,
|
||||
"ios",
|
||||
};
|
||||
|
@ -648,12 +648,6 @@ static void rgui_navigation_ascend_alphabet(void *data, size_t *unused)
|
||||
rgui_navigation_set(data, true);
|
||||
}
|
||||
|
||||
static void rgui_update_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
}
|
||||
|
||||
static void rgui_populate_entries(void *data, const char *path,
|
||||
const char *label, unsigned k)
|
||||
{
|
||||
@ -686,8 +680,6 @@ menu_ctx_driver_t menu_ctx_rgui = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rgui_update_core_info,
|
||||
rgui_entry_iterate,
|
||||
"rgui",
|
||||
};
|
||||
|
@ -367,12 +367,6 @@ 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 = {
|
||||
rmenu_set_texture,
|
||||
rmenu_render_messagebox,
|
||||
@ -399,8 +393,6 @@ menu_ctx_driver_t menu_ctx_rmenu = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rmenu_update_core_info,
|
||||
rmenu_entry_iterate,
|
||||
"rmenu",
|
||||
};
|
||||
|
@ -688,12 +688,6 @@ static void rmenu_xui_list_set_selection(void *data)
|
||||
XuiListSetCurSel(m_menulist, file_list_get_directory_ptr(list));
|
||||
}
|
||||
|
||||
static void rmenu_xui_update_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_rmenu_xui = {
|
||||
NULL,
|
||||
rmenu_xui_render_messagebox,
|
||||
@ -719,8 +713,6 @@ menu_ctx_driver_t menu_ctx_rmenu_xui = {
|
||||
rmenu_xui_list_clear,
|
||||
NULL,
|
||||
rmenu_xui_list_set_selection,
|
||||
NULL,
|
||||
rmenu_xui_update_core_info,
|
||||
rmenu_xui_entry_iterate,
|
||||
"rmenu_xui",
|
||||
};
|
||||
|
@ -1093,9 +1093,7 @@ static void xmb_frame(void)
|
||||
xmb_draw_icon(xmb->textures[XMB_TEXTURE_ARROW].id,
|
||||
xmb->x + xmb->margin_left + xmb->hspacing - xmb->icon_size/2.0 + xmb->icon_size,
|
||||
xmb->margin_top + xmb->icon_size/2.0 + xmb->vspacing * xmb->active_item_factor,
|
||||
xmb->arrow_alpha,
|
||||
0,
|
||||
1);
|
||||
xmb->arrow_alpha, 0, 1);
|
||||
|
||||
depth = file_list_get_size(driver.menu->menu_list->menu_stack);
|
||||
|
||||
@ -1163,21 +1161,6 @@ static void xmb_frame(void)
|
||||
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
|
||||
}
|
||||
|
||||
static void xmb_init_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
core_info_list_free(g_extern.core_info);
|
||||
g_extern.core_info = NULL;
|
||||
if (*g_settings.libretro_directory)
|
||||
g_extern.core_info = core_info_list_new(g_settings.libretro_directory);
|
||||
}
|
||||
|
||||
static void xmb_update_core_info(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void *xmb_init(void)
|
||||
{
|
||||
menu_handle_t *menu = NULL;
|
||||
@ -1268,12 +1251,15 @@ static void *xmb_init(void)
|
||||
xmb->label_margin_top = xmb->font_size/3.0;
|
||||
xmb->setting_margin_left = 600.0 * scale_factor;
|
||||
|
||||
xmb_init_core_info(menu);
|
||||
|
||||
xmb->num_categories = 1;
|
||||
|
||||
if (g_extern.core_info)
|
||||
xmb->num_categories = g_extern.core_info->count + 1;
|
||||
if (!g_extern.core_info)
|
||||
{
|
||||
RARCH_ERR("Global core informations not initialized.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
xmb->num_categories = g_extern.core_info->count + 1;
|
||||
|
||||
return menu;
|
||||
|
||||
@ -1291,13 +1277,8 @@ static void xmb_free(void *data)
|
||||
{
|
||||
menu_handle_t *menu = (menu_handle_t*)data;
|
||||
|
||||
if (g_extern.core_info)
|
||||
core_info_list_free(g_extern.core_info);
|
||||
|
||||
if (menu->userdata)
|
||||
free(menu->userdata);
|
||||
|
||||
g_extern.core_info = NULL;
|
||||
}
|
||||
|
||||
static bool xmb_font_init_first(const gl_font_renderer_t **font_driver,
|
||||
@ -1742,8 +1723,6 @@ menu_ctx_driver_t menu_ctx_xmb = {
|
||||
xmb_list_clear,
|
||||
xmb_list_cache,
|
||||
xmb_list_set_selection,
|
||||
xmb_init_core_info,
|
||||
xmb_update_core_info,
|
||||
xmb_entry_iterate,
|
||||
"xmb",
|
||||
};
|
||||
|
10
menu/menu.c
10
menu/menu.c
@ -65,6 +65,8 @@ void menu_update_libretro_info(struct retro_system_info *info)
|
||||
g_extern.core_info = NULL;
|
||||
if (*g_settings.libretro_directory)
|
||||
g_extern.core_info = core_info_list_new(g_settings.libretro_directory);
|
||||
if (driver.menu_ctx && driver.menu_ctx->context_reset)
|
||||
driver.menu_ctx->context_reset(driver.menu);
|
||||
|
||||
rarch_update_system_info(info, NULL);
|
||||
}
|
||||
@ -147,9 +149,7 @@ bool menu_load_content(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (driver.menu && driver.menu_ctx
|
||||
&& driver.menu_ctx->update_core_info)
|
||||
driver.menu_ctx->update_core_info(driver.menu);
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
|
||||
menu_shader_manager_init(driver.menu);
|
||||
|
||||
@ -176,6 +176,8 @@ void *menu_init(const void *data)
|
||||
if (!menu_ctx)
|
||||
return NULL;
|
||||
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
|
||||
if (!(menu = (menu_handle_t*)menu_ctx->init()))
|
||||
return NULL;
|
||||
|
||||
@ -192,8 +194,6 @@ void *menu_init(const void *data)
|
||||
menu->push_start_screen = g_settings.menu_show_start_screen;
|
||||
g_settings.menu_show_start_screen = false;
|
||||
|
||||
menu_update_libretro_info(&g_extern.menu.info);
|
||||
|
||||
menu_shader_manager_init(menu);
|
||||
|
||||
return menu;
|
||||
|
@ -201,8 +201,6 @@ typedef struct menu_ctx_driver
|
||||
void (*list_clear)(void *);
|
||||
void (*list_cache)(bool, unsigned);
|
||||
void (*list_set_selection)(void *);
|
||||
void (*init_core_info)(void *);
|
||||
void (*update_core_info)(void *);
|
||||
int (*entry_iterate)(unsigned);
|
||||
const char *ident;
|
||||
} menu_ctx_driver_t;
|
||||
|
@ -2762,15 +2762,8 @@ bool rarch_main_command(unsigned cmd)
|
||||
case RARCH_CMD_CORE_INFO_INIT:
|
||||
rarch_main_command(RARCH_CMD_CORE_INFO_DEINIT);
|
||||
|
||||
if (*g_settings.libretro_directory &&
|
||||
!g_extern.core_info)
|
||||
{
|
||||
if (*g_settings.libretro_directory && !g_extern.core_info)
|
||||
g_extern.core_info = core_info_list_new(g_settings.libretro_directory);
|
||||
#ifdef HAVE_MENU
|
||||
if (driver.menu_ctx && driver.menu_ctx->init_core_info)
|
||||
driver.menu_ctx->init_core_info(driver.menu);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case RARCH_CMD_CORE_DEINIT:
|
||||
deinit_core();
|
||||
|
Loading…
x
Reference in New Issue
Block a user