mirror of
https://github.com/libretro/RetroArch
synced 2025-04-25 09:02:44 +00:00
(XMB) Split xmb_get_userdata_from_core up into two functions
This commit is contained in:
parent
e6588a84a6
commit
58e81410fb
@ -694,28 +694,13 @@ static void xmb_list_open_new(xmb_handle_t *xmb, file_list_t *list, int dir, siz
|
|||||||
xmb->old_depth = xmb->depth;
|
xmb->old_depth = xmb->depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
static xmb_node_t* xmb_get_userdata_from_core(xmb_handle_t *xmb, int i)
|
static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, core_info_t *info, int i)
|
||||||
{
|
{
|
||||||
core_info_t *info = NULL;
|
|
||||||
xmb_node_t *node = NULL;
|
xmb_node_t *node = NULL;
|
||||||
core_info_list_t *info_list = (core_info_list_t*)g_extern.core_info;
|
|
||||||
|
|
||||||
if (!info_list)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (!info_list->count)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
info = (core_info_t*)&info_list->list[i];
|
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
node = (xmb_node_t*)info->userdata;
|
|
||||||
|
|
||||||
if (node)
|
|
||||||
return node;
|
|
||||||
|
|
||||||
info->userdata = (xmb_node_t*)calloc(1, sizeof(xmb_node_t));
|
info->userdata = (xmb_node_t*)calloc(1, sizeof(xmb_node_t));
|
||||||
|
|
||||||
if (!info->userdata)
|
if (!info->userdata)
|
||||||
@ -741,6 +726,30 @@ static xmb_node_t* xmb_get_userdata_from_core(xmb_handle_t *xmb, int i)
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static xmb_node_t* xmb_get_userdata_from_core(xmb_handle_t *xmb, int i)
|
||||||
|
{
|
||||||
|
core_info_t *info = NULL;
|
||||||
|
xmb_node_t *node = NULL;
|
||||||
|
core_info_list_t *info_list = (core_info_list_t*)g_extern.core_info;
|
||||||
|
|
||||||
|
if (!info_list)
|
||||||
|
return NULL;
|
||||||
|
if (!info_list->count)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
info = (core_info_t*)&info_list->list[i];
|
||||||
|
|
||||||
|
if (!info)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
node = (xmb_node_t*)info->userdata;
|
||||||
|
|
||||||
|
if (!node)
|
||||||
|
return xmb_node_allocate_userdata(xmb, info, i);
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
static void xmb_push_animations(xmb_node_t *node, float ia, float ix)
|
static void xmb_push_animations(xmb_node_t *node, float ia, float ix)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = menu_driver_resolve();
|
menu_handle_t *menu = menu_driver_resolve();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user