mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Menu) Create menu_list_new
This commit is contained in:
parent
ed6fc11e95
commit
ac61e0de3d
@ -148,7 +148,7 @@ static void disp_set_label(unsigned *w, unsigned type, unsigned i,
|
||||
if (type == MENU_FILE_CORE)
|
||||
{
|
||||
strlcpy(type_str, "(CORE)", type_str_size);
|
||||
file_list_get_alt_at_offset(driver.menu->selection_buf, i, &path);
|
||||
menu_list_get_alt_at_offset(driver.menu->selection_buf, i, &path);
|
||||
*w = 6;
|
||||
}
|
||||
else if (type == MENU_FILE_PLAIN)
|
||||
|
@ -48,6 +48,25 @@ void menu_list_free(menu_list_t *menu_list)
|
||||
menu_list_destroy(menu_list->selection_buf);
|
||||
}
|
||||
|
||||
void *menu_list_new(void)
|
||||
{
|
||||
menu_list_t *list = (menu_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
if (!list)
|
||||
return NULL;
|
||||
|
||||
list->menu_stack = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
list->selection_buf = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
|
||||
if (!list->menu_stack || !list->selection_buf)
|
||||
{
|
||||
free(list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
size_t menu_list_get_stack_size(void)
|
||||
{
|
||||
if (!driver.menu)
|
||||
|
@ -31,6 +31,8 @@ typedef struct menu_list
|
||||
|
||||
void menu_list_free(menu_list_t *menu_list);
|
||||
|
||||
void *menu_list_new(void);
|
||||
|
||||
void menu_list_destroy(file_list_t *list);
|
||||
|
||||
void menu_list_flush_stack(file_list_t *list,
|
||||
|
Loading…
x
Reference in New Issue
Block a user