mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-29 15:32:01 +00:00
Add menu_entries_push_menu_stack
This commit is contained in:
parent
6826a3833e
commit
bb6f66fc44
@ -613,6 +613,33 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||
menu_cbs_init(list, cbs, path, label, type, idx);
|
||||
}
|
||||
|
||||
void menu_entries_push_menu_stack(file_list_t *list, const char *path, const char *label,
|
||||
unsigned type, size_t directory_ptr, size_t entry_idx)
|
||||
{
|
||||
file_list_t **menu_stack = NULL;
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
|
||||
if (!menu_list)
|
||||
return;
|
||||
|
||||
menu_stack = (file_list_t**)realloc(menu_stack, (menu_list->menu_stack_size + 1) * sizeof(file_list_t));
|
||||
|
||||
if (!menu_stack)
|
||||
goto error;
|
||||
|
||||
menu_list->menu_stack = menu_stack;
|
||||
menu_list->menu_stack_size++;
|
||||
menu_list->menu_stack[menu_list->menu_stack_size] = (file_list_t*)calloc(1, sizeof(*menu_list->menu_stack[menu_list->menu_stack_size]));
|
||||
|
||||
menu_entries_push(menu_list->menu_stack[menu_list->menu_stack_size], path, label, type, directory_ptr, entry_idx);
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
if (list)
|
||||
free(menu_stack);
|
||||
}
|
||||
|
||||
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void)
|
||||
{
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
|
@ -168,6 +168,9 @@ void menu_entries_clear(file_list_t *list);
|
||||
void menu_entries_set_alt_at_offset(file_list_t *list, size_t idx,
|
||||
const char *alt);
|
||||
|
||||
void menu_entries_push_menu_stack(file_list_t *list, const char *path, const char *label,
|
||||
unsigned type, size_t directory_ptr, size_t entry_idx);
|
||||
|
||||
void menu_entries_refresh(file_list_t *list);
|
||||
|
||||
rarch_setting_t *menu_entries_get_setting(uint32_t i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user