mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Add MENU_ENTRIES_CTL_DEINIT
This commit is contained in:
parent
fde4826754
commit
a1112d64a0
@ -539,7 +539,7 @@ void menu_free(menu_handle_t *menu)
|
|||||||
menu_driver_free(menu);
|
menu_driver_free(menu);
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_DEINIT, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_DEINIT, NULL);
|
||||||
menu_display_free();
|
menu_display_free();
|
||||||
menu_entries_free();
|
menu_entries_ctl(MENU_ENTRIES_CTL_DEINIT, NULL);
|
||||||
|
|
||||||
event_command(EVENT_CMD_HISTORY_DEINIT);
|
event_command(EVENT_CMD_HISTORY_DEINIT);
|
||||||
|
|
||||||
|
@ -561,24 +561,6 @@ error:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_entries_free(void)
|
|
||||||
{
|
|
||||||
menu_entries_t *entries = menu_entries_data;
|
|
||||||
|
|
||||||
if (!entries)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (entries->list_settings)
|
|
||||||
menu_setting_free(entries->list_settings);
|
|
||||||
entries->list_settings = NULL;
|
|
||||||
|
|
||||||
menu_list_free(entries->menu_list);
|
|
||||||
entries->menu_list = NULL;
|
|
||||||
|
|
||||||
free(menu_entries_data);
|
|
||||||
menu_entries_data = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||||
unsigned type, size_t directory_ptr, size_t entry_idx)
|
unsigned type, size_t directory_ptr, size_t entry_idx)
|
||||||
{
|
{
|
||||||
@ -721,12 +703,28 @@ rarch_setting_t *menu_entries_get_setting(uint32_t i)
|
|||||||
|
|
||||||
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
|
menu_entries_t *entries = menu_entries_data;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
/* Returns true if a Back button should be shown
|
case MENU_ENTRIES_CTL_DEINIT:
|
||||||
* (i.e. we are at least
|
if (!entries)
|
||||||
* one level deep in the menu hierarchy). */
|
return false;
|
||||||
|
|
||||||
|
if (entries->list_settings)
|
||||||
|
menu_setting_free(entries->list_settings);
|
||||||
|
entries->list_settings = NULL;
|
||||||
|
|
||||||
|
menu_list_free(entries->menu_list);
|
||||||
|
entries->menu_list = NULL;
|
||||||
|
|
||||||
|
free(menu_entries_data);
|
||||||
|
menu_entries_data = NULL;
|
||||||
|
return true;
|
||||||
case MENU_ENTRIES_CTL_SHOW_BACK:
|
case MENU_ENTRIES_CTL_SHOW_BACK:
|
||||||
|
/* Returns true if a Back button should be shown
|
||||||
|
* (i.e. we are at least
|
||||||
|
* one level deep in the menu hierarchy). */
|
||||||
return (menu_entries_get_stack_size(0) > 1);
|
return (menu_entries_get_stack_size(0) > 1);
|
||||||
case MENU_ENTRIES_CTL_NONE:
|
case MENU_ENTRIES_CTL_NONE:
|
||||||
default:
|
default:
|
||||||
|
@ -104,6 +104,7 @@ typedef struct menu_file_list_cbs
|
|||||||
enum menu_entries_ctl_state
|
enum menu_entries_ctl_state
|
||||||
{
|
{
|
||||||
MENU_ENTRIES_CTL_NONE = 0,
|
MENU_ENTRIES_CTL_NONE = 0,
|
||||||
|
MENU_ENTRIES_CTL_DEINIT,
|
||||||
MENU_ENTRIES_CTL_SHOW_BACK
|
MENU_ENTRIES_CTL_SHOW_BACK
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,8 +139,6 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
|||||||
|
|
||||||
bool menu_entries_init(void);
|
bool menu_entries_init(void);
|
||||||
|
|
||||||
void menu_entries_free(void);
|
|
||||||
|
|
||||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||||
unsigned *file_type, size_t *entry_idx);
|
unsigned *file_type, size_t *entry_idx);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user