mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
Create file_list_set_userdata/file_list_set_actiondata
This commit is contained in:
parent
c607915ef8
commit
087e1354ec
@ -182,8 +182,9 @@ void file_list_copy(file_list_t *list, file_list_t *list_old)
|
||||
list_old->list[i].type = list->list[i].type;
|
||||
list_old->list[i].directory_ptr = list->list[i].directory_ptr;
|
||||
list_old->list[i].entry_idx = list->list[i].entry_idx;
|
||||
list_old->list[i].userdata = list->list[i].userdata;
|
||||
list_old->list[i].actiondata = list->list[i].actiondata;
|
||||
|
||||
file_list_set_actiondata(list_old, i, list->list[i].actiondata);
|
||||
file_list_set_userdata (list_old, i, list->list[i].userdata);
|
||||
|
||||
if (list->list[i].path)
|
||||
list_old->list[i].path = strdup(list->list[i].path);
|
||||
@ -282,6 +283,20 @@ void *file_list_get_userdata_at_offset(const file_list_t *list, size_t idx)
|
||||
return list->list[idx].userdata;
|
||||
}
|
||||
|
||||
void file_list_set_userdata(const file_list_t *list, size_t idx, void *ptr)
|
||||
{
|
||||
if (!list || !ptr)
|
||||
return;
|
||||
list->list[idx].userdata = ptr;
|
||||
}
|
||||
|
||||
void file_list_set_actiondata(const file_list_t *list, size_t idx, void *ptr)
|
||||
{
|
||||
if (!list || !ptr)
|
||||
return;
|
||||
list->list[idx].actiondata = ptr;
|
||||
}
|
||||
|
||||
void *file_list_get_actiondata_at_offset(const file_list_t *list, size_t idx)
|
||||
{
|
||||
if (!list)
|
||||
|
@ -97,6 +97,10 @@ void file_list_get_label_at_offset(const file_list_t *list, size_t index,
|
||||
void file_list_set_alt_at_offset(file_list_t *list, size_t index,
|
||||
const char *alt);
|
||||
|
||||
void file_list_set_userdata(const file_list_t *list, size_t idx, void *ptr);
|
||||
|
||||
void file_list_set_actiondata(const file_list_t *list, size_t idx, void *ptr);
|
||||
|
||||
void file_list_get_alt_at_offset(const file_list_t *list, size_t index,
|
||||
const char **alt);
|
||||
|
||||
|
@ -635,13 +635,7 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
|
||||
|
||||
static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, unsigned i)
|
||||
{
|
||||
xmb_node_t *node = NULL;
|
||||
struct item_file *info = (struct item_file*)&xmb->horizontal_list->list[i];
|
||||
|
||||
if (!info)
|
||||
return NULL;
|
||||
|
||||
node = (xmb_node_t*)calloc(1, sizeof(xmb_node_t));
|
||||
xmb_node_t *node = (xmb_node_t*)calloc(1, sizeof(xmb_node_t));
|
||||
|
||||
if (!node)
|
||||
{
|
||||
@ -658,7 +652,7 @@ static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, unsigned i)
|
||||
node->zoom = xmb->categories.active.zoom;
|
||||
}
|
||||
|
||||
info->actiondata = node;
|
||||
file_list_set_actiondata(xmb->horizontal_list, i, node);
|
||||
|
||||
return node;
|
||||
}
|
||||
@ -1920,7 +1914,7 @@ static void xmb_list_insert(file_list_t *list,
|
||||
node->zoom = xmb->item.active.zoom;
|
||||
}
|
||||
|
||||
list->list[i].userdata = (xmb_node_t*)node;
|
||||
file_list_set_userdata(list, i, node);
|
||||
}
|
||||
|
||||
static void xmb_list_delete(file_list_t *list,
|
||||
|
Loading…
x
Reference in New Issue
Block a user