Create menu_list_get_userdata_at_offset

This commit is contained in:
twinaphex 2015-06-12 14:50:06 +02:00
parent bf4ef3fd82
commit 30e29cfb5a
3 changed files with 15 additions and 6 deletions

View File

@ -524,7 +524,7 @@ static void xmb_selection_pointer_changed(void)
float iy;
float ia = xmb->item.passive.alpha;
float iz = xmb->item.passive.zoom;
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
xmb_node_t *node = (xmb_node_t*)menu_list_get_userdata_at_offset(
menu_list->selection_buf, i);
if (!node)
@ -564,7 +564,7 @@ static void xmb_list_open_old(xmb_handle_t *xmb,
for (i = 0; i < end; i++)
{
float ia = 0;
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(list, i);
xmb_node_t *node = (xmb_node_t*)menu_list_get_userdata_at_offset(list, i);
if (!node)
continue;
@ -600,7 +600,7 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
{
float ia;
xmb_node_t *node = (xmb_node_t*)
file_list_get_userdata_at_offset(list, i);
menu_list_get_userdata_at_offset(list, i);
if (!node)
continue;
@ -693,7 +693,7 @@ static void xmb_list_switch_old(xmb_handle_t *xmb,
for (i = 0; i < end; i++)
{
xmb_node_t *node = (xmb_node_t*)
file_list_get_userdata_at_offset(list, i);
menu_list_get_userdata_at_offset(list, i);
float ia = 0;
if (!node)
@ -738,7 +738,7 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
for (i = 0; i < end; i++)
{
xmb_node_t *node = (xmb_node_t*)
file_list_get_userdata_at_offset(list, i);
menu_list_get_userdata_at_offset(list, i);
float ia = 0.5;
if (!node)
@ -1025,7 +1025,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
menu_entry_t entry = {{0}};
GLuint texture_switch = 0;
GLuint icon = 0;
xmb_node_t * node = (xmb_node_t*)file_list_get_userdata_at_offset(list, i);
xmb_node_t * node = (xmb_node_t*)menu_list_get_userdata_at_offset(list, i);
menu_handle_t *menu = menu_driver_get_ptr();
uint32_t hash_label = 0;
uint32_t hash_value = 0;

View File

@ -224,6 +224,13 @@ void menu_list_get_last_stack(const menu_list_t *list,
menu_list_get_last(list->menu_stack, path, label, file_type, entry_idx);
}
void *menu_list_get_userdata_at_offset(const file_list_t *list, size_t idx)
{
if (!list)
return NULL;
return (menu_file_list_cbs_t*)file_list_get_userdata_at_offset(list, idx);
}
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx)
{
if (!list)

View File

@ -89,6 +89,8 @@ void menu_list_get_at_offset(const file_list_t *list, size_t idx,
const char **path, const char **label, unsigned *file_type,
size_t *entry_idx);
void *menu_list_get_userdata_at_offset(const file_list_t *list, size_t idx);
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx);
size_t menu_list_get_stack_size(menu_list_t *list);