remove menu_entries_get_stack_size

This commit is contained in:
libretroadmin 2023-05-10 05:03:40 +02:00
parent 9861073363
commit 29329ba62f
5 changed files with 35 additions and 26 deletions

View File

@ -5318,7 +5318,13 @@ static size_t materialui_list_get_size(void *data, enum menu_list_type type)
switch (type)
{
case MENU_LIST_PLAIN:
return menu_entries_get_stack_size(0);
{
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
if (menu_list)
return MENU_LIST_GET_STACK_SIZE(menu_list, 0);
}
break;
case MENU_LIST_TABS:
if (mui)
return mui->nav_bar.num_menu_tabs;

View File

@ -4720,17 +4720,23 @@ static size_t ozone_list_get_size(void *data, enum menu_list_type type)
{
ozone_handle_t *ozone = (ozone_handle_t*) data;
if (!ozone)
return 0;
switch (type)
if (ozone)
{
case MENU_LIST_PLAIN:
return menu_entries_get_stack_size(0);
case MENU_LIST_HORIZONTAL:
return ozone->horizontal_list.size;
case MENU_LIST_TABS:
return ozone->system_tab_end;
switch (type)
{
case MENU_LIST_PLAIN:
{
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
if (menu_list)
return MENU_LIST_GET_STACK_SIZE(menu_list, 0);
}
break;
case MENU_LIST_HORIZONTAL:
return ozone->horizontal_list.size;
case MENU_LIST_TABS:
return ozone->system_tab_end;
}
}
return 0;
@ -7948,6 +7954,7 @@ static enum menu_action ozone_parse_menu_entry_action(
bool is_current_entry_settings = false;
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
size_t menu_stack_size = MENU_LIST_GET_STACK_SIZE(menu_list, 0);
settings_t *settings = config_get_ptr();
enum menu_action new_action = action;
file_list_t *selection_buf = NULL;
@ -8316,7 +8323,7 @@ static enum menu_action ozone_parse_menu_entry_action(
break;
}
if (menu_entries_get_stack_size(0) == 1)
if (menu_stack_size == 1)
{
ozone_go_to_sidebar(ozone, ozone_collapse_sidebar, tag);
new_action = MENU_ACTION_ACCESSIBILITY_SPEAK_TITLE;

View File

@ -827,7 +827,13 @@ static size_t xmb_list_get_size(void *data, enum menu_list_type type)
switch (type)
{
case MENU_LIST_PLAIN:
return menu_entries_get_stack_size(0);
{
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
if (menu_list)
return MENU_LIST_GET_STACK_SIZE(menu_list, 0);
}
break;
case MENU_LIST_HORIZONTAL:
return xmb->horizontal_list.size;
case MENU_LIST_TABS:
@ -4528,8 +4534,9 @@ static int xmb_menu_entry_action(
static enum menu_action xmb_parse_menu_entry_action(
xmb_handle_t *xmb, enum menu_action action)
{
struct menu_state *menu_st = menu_state_get_ptr();
enum menu_action new_action = action;
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
/* Scan user inputs */
switch (action)
@ -4666,7 +4673,7 @@ static enum menu_action xmb_parse_menu_entry_action(
/* Back up to Main Menu and first item */
if ( !menu_entries_search_get_terms()
&& menu_entries_get_stack_size(0) == 1)
&& MENU_LIST_GET_STACK_SIZE(menu_list, 0) == 1)
{
if (xmb_get_system_tab(xmb,
(unsigned)xmb->categories_selection_ptr) == XMB_SYSTEM_TAB_MAIN)

View File

@ -512,15 +512,6 @@ file_list_t *menu_entries_get_selection_buf_ptr(size_t idx)
return MENU_LIST_GET_SELECTION(menu_list, (unsigned)idx);
}
size_t menu_entries_get_stack_size(size_t idx)
{
struct menu_state *menu_st = &menu_driver_state;
menu_list_t *menu_list = menu_st->entries.list;
if (!menu_list)
return 0;
return MENU_LIST_GET_STACK_SIZE(menu_list, idx);
}
size_t menu_entries_get_size(void)
{
struct menu_state *menu_st = &menu_driver_state;

View File

@ -177,8 +177,6 @@ void menu_entries_pop_stack(size_t *ptr, size_t idx, bool animate);
void menu_entries_flush_stack(const char *needle, unsigned final_type);
size_t menu_entries_get_stack_size(size_t idx);
size_t menu_entries_get_size(void);
void menu_entries_prepend(file_list_t *list,