mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-21 10:20:21 +00:00
Refactor menu_parse_and_resolve - add call to menu_entries_push
and add int returnvalue for menu_entries_push
This commit is contained in:
parent
f348d4866f
commit
5d9f96bc07
@ -1685,6 +1685,12 @@ static int menu_parse_and_resolve(void)
|
||||
/* Directory parse */
|
||||
file_list_get_last(driver.menu->menu_stack, &dir, &label, &menu_type);
|
||||
|
||||
if (
|
||||
menu_type == MENU_SETTINGS_DEFERRED_CORE ||
|
||||
menu_type == MENU_SETTINGS_OPEN_HISTORY
|
||||
)
|
||||
return menu_entries_push(driver.menu, dir, label, menu_type);
|
||||
|
||||
if (!((menu_type == MENU_FILE_DIRECTORY ||
|
||||
menu_common_type_is(menu_type) == MENU_SETTINGS_SHADER_OPTIONS ||
|
||||
menu_common_type_is(menu_type) == MENU_FILE_DIRECTORY ||
|
||||
@ -2380,15 +2386,7 @@ static int menu_common_iterate(unsigned action)
|
||||
// refresh values in case the stack changed
|
||||
file_list_get_last(driver.menu->menu_stack, &dir, &label, &menu_type);
|
||||
|
||||
if (driver.menu->need_refresh &&
|
||||
(menu_type == MENU_SETTINGS_DEFERRED_CORE ||
|
||||
menu_type == MENU_SETTINGS_OPEN_HISTORY)
|
||||
)
|
||||
{
|
||||
driver.menu->need_refresh = false;
|
||||
menu_entries_push(driver.menu, dir, label, menu_type);
|
||||
}
|
||||
else if (driver.menu->need_refresh)
|
||||
if (driver.menu->need_refresh)
|
||||
{
|
||||
if (menu_parse_and_resolve() == 0)
|
||||
driver.menu->need_refresh = false;
|
||||
|
@ -39,7 +39,7 @@ static void add_setting_entry(menu_handle_t *menu, const char *label, unsigned i
|
||||
id, 0);
|
||||
}
|
||||
|
||||
void menu_entries_push(menu_handle_t *menu,
|
||||
int menu_entries_push(menu_handle_t *menu,
|
||||
const char *path, const char *label,
|
||||
unsigned menu_type)
|
||||
{
|
||||
@ -171,7 +171,7 @@ void menu_entries_push(menu_handle_t *menu,
|
||||
struct gfx_shader *shader = (struct gfx_shader*)menu->shader;
|
||||
|
||||
if (!shader)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
file_list_clear(menu->selection_buf);
|
||||
file_list_push(menu->selection_buf, "Apply Shader Changes", "",
|
||||
@ -544,4 +544,6 @@ void menu_entries_push(menu_handle_t *menu,
|
||||
|
||||
if (driver.menu_ctx && driver.menu_ctx->populate_entries)
|
||||
driver.menu_ctx->populate_entries(menu, path, label, menu_type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "menu_common.h"
|
||||
|
||||
void menu_entries_push(menu_handle_t *menu, const char *path,
|
||||
int menu_entries_push(menu_handle_t *menu, const char *path,
|
||||
const char *label, unsigned menu_type);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user