mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
Start using menu_list_new/menu_list_free
This commit is contained in:
parent
ac61e0de3d
commit
e3894e7b9c
@ -42,7 +42,7 @@ static int menu_message_toggle(unsigned action)
|
||||
driver.menu_ctx->render_messagebox(driver.menu->message_contents);
|
||||
|
||||
if (action == MENU_ACTION_OK)
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -53,7 +53,7 @@ static int menu_info_screen_iterate(unsigned action)
|
||||
char needle[PATH_MAX];
|
||||
unsigned info_type = 0;
|
||||
rarch_setting_t *current_setting = NULL;
|
||||
file_list_t *list = (file_list_t*)driver.menu->selection_buf;
|
||||
file_list_t *list = (file_list_t*)driver.menu->menu_list->selection_buf;
|
||||
|
||||
if (!driver.menu)
|
||||
return 0;
|
||||
@ -77,7 +77,7 @@ static int menu_info_screen_iterate(unsigned action)
|
||||
else
|
||||
{
|
||||
const char *label = NULL;
|
||||
menu_list_get_at_offset(driver.menu->selection_buf,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->selection_ptr, NULL, &label,
|
||||
&info_type);
|
||||
|
||||
@ -95,7 +95,7 @@ static int menu_info_screen_iterate(unsigned action)
|
||||
}
|
||||
|
||||
if (action == MENU_ACTION_OK)
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -109,7 +109,7 @@ static int menu_action_ok(menu_file_list_cbs_t *cbs)
|
||||
if (menu_list_get_size() == 0)
|
||||
return 0;
|
||||
|
||||
menu_list_get_at_offset(driver.menu->selection_buf,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->selection_ptr, &path, &label, &type);
|
||||
|
||||
if (cbs && cbs->action_ok)
|
||||
@ -181,7 +181,7 @@ static int menu_start_screen_iterate(unsigned action)
|
||||
driver.menu_ctx->render_messagebox(msg);
|
||||
|
||||
if (action == MENU_ACTION_OK)
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -195,7 +195,7 @@ static int menu_settings_iterate(unsigned action,
|
||||
|
||||
driver.menu->frame_buf_pitch = driver.menu->width * 2;
|
||||
|
||||
menu_list_get_at_offset(driver.menu->selection_buf,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->selection_ptr, &path, &label, &type);
|
||||
|
||||
if (driver.menu->need_refresh && action != MENU_ACTION_MESSAGE)
|
||||
@ -220,10 +220,10 @@ static int menu_settings_iterate(unsigned action,
|
||||
|
||||
case MENU_ACTION_CANCEL:
|
||||
apply_deferred_settings();
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
break;
|
||||
case MENU_ACTION_SELECT:
|
||||
menu_list_push_stack(driver.menu->menu_stack, "", "info_screen",
|
||||
menu_list_push_stack(driver.menu->menu_list->menu_stack, "", "info_screen",
|
||||
0, driver.menu->selection_ptr);
|
||||
break;
|
||||
case MENU_ACTION_OK:
|
||||
@ -248,8 +248,8 @@ static int menu_settings_iterate(unsigned action,
|
||||
break;
|
||||
|
||||
case MENU_ACTION_REFRESH:
|
||||
menu_entries_deferred_push(driver.menu->selection_buf,
|
||||
driver.menu->menu_stack);
|
||||
menu_entries_deferred_push(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->menu_list->menu_stack);
|
||||
|
||||
driver.menu->need_refresh = false;
|
||||
break;
|
||||
@ -268,7 +268,7 @@ static int menu_settings_iterate(unsigned action,
|
||||
/* Have to defer it so we let settings refresh. */
|
||||
if (driver.menu->push_start_screen)
|
||||
{
|
||||
menu_list_push_stack(driver.menu->menu_stack, "", "help", 0, 0);
|
||||
menu_list_push_stack(driver.menu->menu_list->menu_stack, "", "help", 0, 0);
|
||||
driver.menu->push_start_screen = false;
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ static int menu_viewport_iterate(unsigned action)
|
||||
rarch_viewport_t *custom = (rarch_viewport_t*)
|
||||
&g_extern.console.screen.viewports.custom_vp;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, NULL, &label, &type);
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, NULL, &label, &type);
|
||||
|
||||
geom = (struct retro_game_geometry*)&g_extern.system.av_info.geometry;
|
||||
|
||||
@ -349,21 +349,21 @@ static int menu_viewport_iterate(unsigned action)
|
||||
break;
|
||||
|
||||
case MENU_ACTION_CANCEL:
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
if (!strcmp(label, "custom_viewport_2"))
|
||||
{
|
||||
menu_list_push_stack(driver.menu->menu_stack, "", "",
|
||||
menu_list_push_stack(driver.menu->menu_list->menu_stack, "", "",
|
||||
MENU_SETTINGS_CUSTOM_VIEWPORT,
|
||||
driver.menu->selection_ptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case MENU_ACTION_OK:
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
if (type == MENU_SETTINGS_CUSTOM_VIEWPORT
|
||||
&& !g_settings.video.scale_integer)
|
||||
{
|
||||
menu_list_push_stack(driver.menu->menu_stack, "",
|
||||
menu_list_push_stack(driver.menu->menu_list->menu_stack, "",
|
||||
"custom_viewport_2", 0, driver.menu->selection_ptr);
|
||||
}
|
||||
break;
|
||||
@ -402,7 +402,7 @@ static int menu_viewport_iterate(unsigned action)
|
||||
break;
|
||||
}
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, NULL, &label, &type);
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, NULL, &label, &type);
|
||||
|
||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
|
||||
driver.menu_ctx->render();
|
||||
@ -454,7 +454,7 @@ static int menu_viewport_iterate(unsigned action)
|
||||
static void menu_common_load_content(void)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_LOAD_CONTENT);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
driver.menu->msg_force = true;
|
||||
}
|
||||
|
||||
@ -483,15 +483,15 @@ static int menu_load_or_open_zip_iterate(unsigned action)
|
||||
{
|
||||
case MENU_ACTION_OK:
|
||||
case MENU_ACTION_CANCEL:
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, &menu_label, NULL);
|
||||
|
||||
if (menu_list_get_size() == 0)
|
||||
return 0;
|
||||
|
||||
menu_list_get_at_offset(driver.menu->selection_buf,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->selection_ptr, &path, NULL, &type);
|
||||
break;
|
||||
}
|
||||
@ -504,7 +504,7 @@ static int menu_load_or_open_zip_iterate(unsigned action)
|
||||
|
||||
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
cat_path,
|
||||
menu_label,
|
||||
type,
|
||||
@ -524,7 +524,7 @@ static int menu_load_or_open_zip_iterate(unsigned action)
|
||||
}
|
||||
else if (ret == 0)
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
g_settings.libretro_directory,
|
||||
"deferred_core_list",
|
||||
0,
|
||||
@ -544,10 +544,10 @@ static int menu_common_iterate(unsigned action)
|
||||
const char *label = NULL;
|
||||
unsigned scroll_speed = 0, fast_scroll_speed = 0;
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
menu_list_get_actiondata_at_offset(driver.menu->selection_buf,
|
||||
menu_list_get_actiondata_at_offset(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->selection_ptr);
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, NULL, &label, &type);
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, NULL, &label, &type);
|
||||
|
||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->set_texture)
|
||||
driver.menu_ctx->set_texture(driver.menu);
|
||||
@ -570,13 +570,13 @@ static int menu_common_iterate(unsigned action)
|
||||
else if (type == MENU_SETTINGS_CUSTOM_BIND)
|
||||
{
|
||||
if (menu_input_bind_iterate(driver.menu))
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
return 0;
|
||||
}
|
||||
else if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD)
|
||||
{
|
||||
if (menu_input_bind_iterate_keyboard(driver.menu))
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -629,7 +629,7 @@ static int menu_common_iterate(unsigned action)
|
||||
break;
|
||||
|
||||
case MENU_ACTION_CANCEL:
|
||||
menu_list_pop_stack(driver.menu->menu_stack);
|
||||
menu_list_pop_stack(driver.menu->menu_list->menu_stack);
|
||||
break;
|
||||
|
||||
case MENU_ACTION_OK:
|
||||
@ -637,13 +637,13 @@ static int menu_common_iterate(unsigned action)
|
||||
break;
|
||||
|
||||
case MENU_ACTION_SELECT:
|
||||
menu_list_push_stack(driver.menu->menu_stack, "", "info_screen",
|
||||
menu_list_push_stack(driver.menu->menu_list->menu_stack, "", "info_screen",
|
||||
0, driver.menu->selection_ptr);
|
||||
break;
|
||||
|
||||
case MENU_ACTION_REFRESH:
|
||||
menu_entries_deferred_push(driver.menu->selection_buf,
|
||||
driver.menu->menu_stack);
|
||||
menu_entries_deferred_push(driver.menu->menu_list->selection_buf,
|
||||
driver.menu->menu_list->menu_stack);
|
||||
|
||||
driver.menu->need_refresh = false;
|
||||
break;
|
||||
|
@ -254,7 +254,7 @@ static void glui_frame(void)
|
||||
|
||||
glui_render_background(false);
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, &dir, &label, &menu_type);
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, &dir, &label, &menu_type);
|
||||
|
||||
get_title(label, dir, menu_type, title, sizeof(title));
|
||||
|
||||
@ -295,11 +295,11 @@ static void glui_frame(void)
|
||||
unsigned type = 0, w = 0;
|
||||
bool selected = false;
|
||||
|
||||
menu_list_get_at_offset(driver.menu->selection_buf, i, &path,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf, i, &path,
|
||||
&entry_label, &type);
|
||||
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(
|
||||
driver.menu->list_settings,
|
||||
driver.menu->selection_buf->list[i].label);
|
||||
driver.menu->menu_list->selection_buf->list[i].label);
|
||||
(void)setting;
|
||||
|
||||
disp_set_label(&w, type, i, label,
|
||||
|
@ -296,7 +296,8 @@ static void rgui_render(void)
|
||||
const char *dir = NULL;
|
||||
const char *label = NULL;
|
||||
unsigned menu_type = 0;
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, &dir, &label, &menu_type);
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&dir, &label, &menu_type);
|
||||
|
||||
#if 0
|
||||
RARCH_LOG("Dir is: %s\n", label);
|
||||
@ -344,11 +345,11 @@ static void rgui_render(void)
|
||||
unsigned type = 0, w = 0;
|
||||
bool selected = false;
|
||||
|
||||
menu_list_get_at_offset(driver.menu->selection_buf, i, &path,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf, i, &path,
|
||||
&entry_label, &type);
|
||||
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(
|
||||
driver.menu->list_settings,
|
||||
driver.menu->selection_buf->list[i].label);
|
||||
driver.menu->menu_list->selection_buf->list[i].label);
|
||||
(void)setting;
|
||||
|
||||
disp_set_label(&w, type, i, label,
|
||||
|
@ -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);
|
||||
menu_list_get_alt_at_offset(driver.menu->selection_buf, i, &path);
|
||||
menu_list_get_alt_at_offset(driver.menu->menu_list->selection_buf, i, &path);
|
||||
*w = 6;
|
||||
}
|
||||
else if (type == MENU_FILE_PLAIN)
|
||||
|
@ -363,7 +363,7 @@ static void xmb_selection_pointer_changed(void)
|
||||
float ia = xmb->i_passive_alpha;
|
||||
float iz = xmb->i_passive_zoom;
|
||||
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
|
||||
driver.menu->selection_buf, i);
|
||||
driver.menu->menu_list->selection_buf, i);
|
||||
|
||||
if (!node)
|
||||
continue;
|
||||
@ -428,7 +428,7 @@ static void xmb_frame(void)
|
||||
|
||||
xmb_render_background(false);
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, &dir, &label, &menu_type);
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, &dir, &label, &menu_type);
|
||||
|
||||
get_title(label, dir, menu_type, xmb->title, sizeof(xmb->title));
|
||||
|
||||
@ -463,10 +463,10 @@ static void xmb_frame(void)
|
||||
unsigned type = 0, w = 0;
|
||||
xmb_node_t *node = NULL;
|
||||
|
||||
menu_list_get_at_offset(driver.menu->selection_buf, i, &path,
|
||||
menu_list_get_at_offset(driver.menu->menu_list->selection_buf, i, &path,
|
||||
&entry_label, &type);
|
||||
node = (xmb_node_t*)file_list_get_userdata_at_offset(
|
||||
driver.menu->selection_buf, i);
|
||||
driver.menu->menu_list->selection_buf, i);
|
||||
|
||||
disp_set_label(&w, type, i, label,
|
||||
val_buf, sizeof(val_buf),
|
||||
|
@ -108,7 +108,7 @@ static int menu_entries_set_current_path_selection(
|
||||
{
|
||||
case MENU_ACTION_OK:
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
start_path,
|
||||
label,
|
||||
type,
|
||||
@ -164,7 +164,7 @@ int menu_action_handle_setting(rarch_setting_t *setting,
|
||||
int menu_action_setting_set(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
const file_list_t *list = (const file_list_t*)driver.menu->selection_buf;
|
||||
const file_list_t *list = (const file_list_t*)driver.menu->menu_list->selection_buf;
|
||||
|
||||
/* Check if setting belongs to settings menu. */
|
||||
|
||||
|
@ -156,8 +156,9 @@ void *menu_init(const void *data)
|
||||
strlcpy(g_settings.menu.driver, menu_ctx->ident,
|
||||
sizeof(g_settings.menu.driver));
|
||||
|
||||
menu->menu_stack = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
menu->selection_buf = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
if (!(menu->menu_list = (menu_list_t*)menu_list_new()))
|
||||
return NULL;
|
||||
|
||||
g_extern.core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t));
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
menu->shader = (struct gfx_shader*)calloc(1, sizeof(struct gfx_shader));
|
||||
@ -223,9 +224,8 @@ void menu_free(void *data)
|
||||
libretro_free_system_info(&g_extern.menu.info);
|
||||
#endif
|
||||
|
||||
//menu_list_free(menu->menu_list);
|
||||
menu_list_destroy(menu->menu_stack);
|
||||
menu_list_destroy(menu->selection_buf);
|
||||
menu_list_free(menu->menu_list);
|
||||
menu->menu_list = NULL;
|
||||
|
||||
rarch_main_command(RARCH_CMD_HISTORY_DEINIT);
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "../../boolean.h"
|
||||
#include "../../file_list.h"
|
||||
#include "menu_list.h"
|
||||
#include "../../settings_list.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -79,8 +79,7 @@ typedef struct
|
||||
uint16_t *frame_buf;
|
||||
size_t frame_buf_pitch;
|
||||
|
||||
file_list_t *menu_stack;
|
||||
file_list_t *selection_buf;
|
||||
menu_list_t *menu_list;
|
||||
size_t selection_ptr;
|
||||
bool need_refresh;
|
||||
bool msg_force;
|
||||
|
@ -405,9 +405,9 @@ bool menu_entries_init(menu_handle_t *menu)
|
||||
menu->list_mainmenu = setting_data_new(SL_FLAG_MAIN_MENU);
|
||||
menu->list_settings = setting_data_new(SL_FLAG_ALL_SETTINGS);
|
||||
|
||||
menu_list_push_stack(menu->menu_stack, "", "Main Menu", MENU_SETTINGS, 0);
|
||||
menu_list_push_stack(menu->menu_list->menu_stack, "", "Main Menu", MENU_SETTINGS, 0);
|
||||
menu_navigation_clear(menu, true);
|
||||
entries_push_main_menu_list(menu, menu->selection_buf,
|
||||
entries_push_main_menu_list(menu, menu->menu_list->selection_buf,
|
||||
"", "Main Menu", 0);
|
||||
|
||||
return true;
|
||||
|
@ -117,7 +117,7 @@ unsigned menu_current_gx_resolution = GX_RESOLUTIONS_640_480;
|
||||
static void common_load_content(void)
|
||||
{
|
||||
rarch_main_command(RARCH_CMD_LOAD_CONTENT);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
driver.menu->msg_force = true;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ static int action_ok_push_content_list(const char *path,
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
g_settings.menu_content_directory,
|
||||
label,
|
||||
MENU_FILE_DIRECTORY,
|
||||
@ -144,7 +144,7 @@ static int action_ok_playlist_entry(const char *path,
|
||||
|
||||
rarch_playlist_load_content(g_defaults.history,
|
||||
driver.menu->selection_ptr);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ static int action_ok_push_history_list(const char *path,
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
"",
|
||||
label,
|
||||
type,
|
||||
@ -170,7 +170,7 @@ static int action_ok_push_path_list(const char *path,
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
"",
|
||||
label,
|
||||
type,
|
||||
@ -197,7 +197,7 @@ static int action_ok_shader_pass_load(const char *path,
|
||||
(void)menu_path;
|
||||
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, &menu_path, NULL,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, &menu_path, NULL,
|
||||
NULL);
|
||||
|
||||
fill_pathname_join(driver.menu->shader->pass[hack_shader_pass].source.path,
|
||||
@ -206,7 +206,7 @@ static int action_ok_shader_pass_load(const char *path,
|
||||
|
||||
/* This will reset any changed parameters. */
|
||||
gfx_shader_resolve_parameters(NULL, driver.menu->shader);
|
||||
menu_list_flush_stack_by_needle(driver.menu->menu_stack, "Shader Options");
|
||||
menu_list_flush_stack_by_needle(driver.menu->menu_list->menu_stack, "Shader Options");
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
@ -224,14 +224,14 @@ static int action_ok_shader_preset_load(const char *path,
|
||||
(void)shader_path;
|
||||
(void)menu_path;
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
menu_list_get_last_stack(driver.menu->menu_stack, &menu_path, NULL,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack, &menu_path, NULL,
|
||||
NULL);
|
||||
|
||||
fill_pathname_join(shader_path, menu_path, path, sizeof(shader_path));
|
||||
menu_shader_manager_set_preset(driver.menu->shader,
|
||||
gfx_shader_parse_type(shader_path, RARCH_SHADER_NONE),
|
||||
shader_path);
|
||||
menu_list_flush_stack_by_needle(driver.menu->menu_stack, "Shader Options");
|
||||
menu_list_flush_stack_by_needle(driver.menu->menu_list->menu_stack, "Shader Options");
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
@ -259,7 +259,7 @@ static int action_ok_path_use_directory(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, &menu_label, NULL);
|
||||
|
||||
setting = (rarch_setting_t*)
|
||||
@ -271,7 +271,7 @@ static int action_ok_path_use_directory(const char *path,
|
||||
if (setting->type == ST_DIR)
|
||||
{
|
||||
menu_action_setting_set_current_string(setting, menu_path);
|
||||
menu_list_pop_stack_by_needle(driver.menu->menu_stack, setting->name);
|
||||
menu_list_pop_stack_by_needle(driver.menu->menu_list->menu_stack, setting->name);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -288,7 +288,7 @@ static int action_ok_core_load_deferred(const char *path,
|
||||
sizeof(g_extern.fullpath));
|
||||
|
||||
rarch_main_command(RARCH_CMD_LOAD_CONTENT);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
driver.menu->msg_force = true;
|
||||
|
||||
return -1;
|
||||
@ -301,20 +301,20 @@ static int action_ok_core_load(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, NULL, NULL);
|
||||
|
||||
fill_pathname_join(g_settings.libretro, menu_path, path,
|
||||
sizeof(g_settings.libretro));
|
||||
rarch_main_command(RARCH_CMD_LOAD_CORE);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
#if defined(HAVE_DYNAMIC)
|
||||
/* No content needed for this core, load core immediately. */
|
||||
if (driver.menu->load_no_content)
|
||||
{
|
||||
*g_extern.fullpath = '\0';
|
||||
rarch_main_command(RARCH_CMD_LOAD_CONTENT);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
driver.menu->msg_force = true;
|
||||
return -1;
|
||||
}
|
||||
@ -338,19 +338,19 @@ static int action_ok_compressed_archive_push(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, &menu_label, NULL);
|
||||
|
||||
if (!strcmp(menu_label, "detect_core_list"))
|
||||
{
|
||||
menu_list_push(driver.menu->menu_stack, path, "load_open_zip",
|
||||
menu_list_push(driver.menu->menu_list->menu_stack, path, "load_open_zip",
|
||||
0, driver.menu->selection_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
cat_path,
|
||||
menu_label,
|
||||
type,
|
||||
@ -369,12 +369,12 @@ static int action_ok_directory_push(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, &menu_label, NULL);
|
||||
|
||||
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
cat_path,
|
||||
menu_label,
|
||||
type,
|
||||
@ -392,11 +392,11 @@ static int action_ok_config_load(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, NULL, NULL);
|
||||
|
||||
fill_pathname_join(config, menu_path, path, sizeof(config));
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
driver.menu->msg_force = true;
|
||||
if (rarch_replace_config(config))
|
||||
{
|
||||
@ -416,7 +416,7 @@ static int action_ok_disk_image_append(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, NULL, NULL);
|
||||
|
||||
fill_pathname_join(image, menu_path, path, sizeof(image));
|
||||
@ -424,7 +424,7 @@ static int action_ok_disk_image_append(const char *path,
|
||||
|
||||
rarch_main_command(RARCH_CMD_RESUME);
|
||||
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -437,7 +437,7 @@ static int action_ok_file_load_with_detect_core(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, NULL, NULL);
|
||||
|
||||
ret = rarch_defer_core(g_extern.core_info,
|
||||
@ -452,7 +452,7 @@ static int action_ok_file_load_with_detect_core(const char *path,
|
||||
}
|
||||
else if (ret == 0)
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
g_settings.libretro_directory,
|
||||
"deferred_core_list",
|
||||
0, driver.menu->selection_ptr);
|
||||
@ -470,7 +470,7 @@ static int action_ok_file_load(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last(driver.menu->menu_stack,
|
||||
menu_list_get_last(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, &menu_label, NULL);
|
||||
|
||||
setting = (rarch_setting_t*)
|
||||
@ -479,7 +479,7 @@ static int action_ok_file_load(const char *path,
|
||||
if (setting && setting->type == ST_PATH)
|
||||
{
|
||||
menu_action_setting_set_current_string_path(setting, menu_path, path);
|
||||
menu_list_pop_stack_by_needle(driver.menu->menu_stack, setting->name);
|
||||
menu_list_pop_stack_by_needle(driver.menu->menu_list->menu_stack, setting->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -492,7 +492,7 @@ static int action_ok_file_load(const char *path,
|
||||
|
||||
common_load_content();
|
||||
rarch_main_command(RARCH_CMD_LOAD_CONTENT_PERSIST);
|
||||
menu_list_flush_stack(driver.menu->menu_stack, MENU_SETTINGS);
|
||||
menu_list_flush_stack(driver.menu->menu_list->menu_stack, MENU_SETTINGS);
|
||||
driver.menu->msg_force = true;
|
||||
|
||||
return -1;
|
||||
@ -511,7 +511,7 @@ static int action_ok_set_path(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
&menu_path, &menu_label, NULL);
|
||||
|
||||
setting = (rarch_setting_t*)
|
||||
@ -521,7 +521,7 @@ static int action_ok_set_path(const char *path,
|
||||
return -1;
|
||||
|
||||
menu_action_setting_set_current_string_path(setting, menu_path, path);
|
||||
menu_list_pop_stack_by_needle(driver.menu->menu_stack, setting->name);
|
||||
menu_list_pop_stack_by_needle(driver.menu->menu_list->menu_stack, setting->name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -537,7 +537,7 @@ static int action_ok_bind_all(const char *path,
|
||||
driver.menu->binds.begin = MENU_SETTINGS_BIND_BEGIN;
|
||||
driver.menu->binds.last = MENU_SETTINGS_BIND_LAST;
|
||||
|
||||
menu_list_push(driver.menu->menu_stack, "", "",
|
||||
menu_list_push(driver.menu->menu_list->menu_stack, "", "",
|
||||
driver.menu->bind_mode_keyboard ?
|
||||
MENU_SETTINGS_CUSTOM_BIND_KEYBOARD :
|
||||
MENU_SETTINGS_CUSTOM_BIND,
|
||||
@ -600,7 +600,7 @@ static int action_ok_bind_key(const char *path,
|
||||
driver.menu->binds.last = type;
|
||||
driver.menu->binds.target = bind;
|
||||
driver.menu->binds.player = driver.menu->current_pad;
|
||||
menu_list_push(driver.menu->menu_stack, "", "",
|
||||
menu_list_push(driver.menu->menu_list->menu_stack, "", "",
|
||||
driver.menu->bind_mode_keyboard ?
|
||||
MENU_SETTINGS_CUSTOM_BIND_KEYBOARD : MENU_SETTINGS_CUSTOM_BIND,
|
||||
driver.menu->selection_ptr);
|
||||
@ -624,7 +624,7 @@ static int action_ok_bind_key(const char *path,
|
||||
static int action_ok_custom_viewport(const char *path,
|
||||
const char *label, unsigned type, size_t index)
|
||||
{
|
||||
menu_list_push(driver.menu->menu_stack, "", "",
|
||||
menu_list_push(driver.menu->menu_list->menu_stack, "", "",
|
||||
MENU_SETTINGS_CUSTOM_VIEWPORT,
|
||||
driver.menu->selection_ptr);
|
||||
|
||||
@ -652,7 +652,7 @@ static int action_ok_core_list(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(driver.menu->menu_stack,
|
||||
menu_list_push_stack_refresh(driver.menu->menu_list->menu_stack,
|
||||
dir, label, type,
|
||||
driver.menu->selection_ptr);
|
||||
|
||||
@ -667,7 +667,7 @@ static int action_ok_disk_image_append_list(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(driver.menu->menu_stack,
|
||||
menu_list_push_stack_refresh(driver.menu->menu_list->menu_stack,
|
||||
dir, label, type,
|
||||
driver.menu->selection_ptr);
|
||||
return 0;
|
||||
@ -680,7 +680,7 @@ static int action_ok_configurations_list(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(driver.menu->menu_stack,
|
||||
menu_list_push_stack_refresh(driver.menu->menu_list->menu_stack,
|
||||
dir ? dir : label, label, type,
|
||||
driver.menu->selection_ptr);
|
||||
return 0;
|
||||
@ -692,7 +692,7 @@ static int action_ok_push_default(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(driver.menu->menu_stack,
|
||||
menu_list_push_stack_refresh(driver.menu->menu_list->menu_stack,
|
||||
label, label, type,
|
||||
driver.menu->selection_ptr);
|
||||
return 0;
|
||||
@ -714,7 +714,7 @@ static int action_ok_help(const char *path,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_push(driver.menu->menu_stack, "", "help", 0, 0);
|
||||
menu_list_push(driver.menu->menu_list->menu_stack, "", "help", 0, 0);
|
||||
driver.menu->push_start_screen = false;
|
||||
|
||||
return 0;
|
||||
@ -813,7 +813,7 @@ static int action_ok_shader_pass(const char *path,
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
g_settings.video.shader_dir,
|
||||
"video_shader_pass",
|
||||
type,
|
||||
@ -847,7 +847,7 @@ static int action_ok_shader_preset(const char *path,
|
||||
return -1;
|
||||
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
g_settings.video.shader_dir,
|
||||
"video_shader_preset",
|
||||
type,
|
||||
@ -1011,7 +1011,7 @@ static int action_ok_shader_parameters(const char *path,
|
||||
{
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack, "",
|
||||
driver.menu->menu_list->menu_stack, "",
|
||||
"video_shader_parameters",
|
||||
MENU_FILE_PUSH,
|
||||
driver.menu->selection_ptr);
|
||||
@ -2223,7 +2223,7 @@ static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
NULL, &menu_label, NULL);
|
||||
|
||||
if (type >= MENU_SETTINGS_BIND_BEGIN &&
|
||||
@ -2453,7 +2453,7 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
if (!cbs || !driver.menu)
|
||||
return;
|
||||
|
||||
menu_list_get_last_stack(driver.menu->menu_stack,
|
||||
menu_list_get_last_stack(driver.menu->menu_list->menu_stack,
|
||||
NULL, &menu_label, NULL);
|
||||
|
||||
cbs->action_deferred_push = deferred_push_default;
|
||||
|
@ -65,7 +65,7 @@ static void menu_search_callback(void *userdata, const char *str)
|
||||
menu_handle_t *menu = (menu_handle_t*)userdata;
|
||||
size_t index;
|
||||
|
||||
if (str && *str && file_list_search(menu->selection_buf, str, &index))
|
||||
if (str && *str && file_list_search(menu->menu_list->selection_buf, str, &index))
|
||||
menu_navigation_set(menu, index);
|
||||
|
||||
menu_key_end_line(menu);
|
||||
|
@ -71,7 +71,7 @@ size_t menu_list_get_stack_size(void)
|
||||
{
|
||||
if (!driver.menu)
|
||||
return 0;
|
||||
return file_list_get_size(driver.menu->menu_stack);
|
||||
return file_list_get_size(driver.menu->menu_list->menu_stack);
|
||||
}
|
||||
|
||||
void menu_list_get_at_offset(const file_list_t *list, size_t index,
|
||||
@ -84,7 +84,7 @@ size_t menu_list_get_size(void)
|
||||
{
|
||||
if (!driver.menu)
|
||||
return 0;
|
||||
return file_list_get_size(driver.menu->selection_buf);
|
||||
return file_list_get_size(driver.menu->menu_list->selection_buf);
|
||||
}
|
||||
|
||||
void menu_list_get_last(const file_list_t *list,
|
||||
|
@ -1142,7 +1142,7 @@ static int setting_data_bind_action_ok(void *data, unsigned action)
|
||||
if (!setting)
|
||||
return -1;
|
||||
|
||||
if (!driver.menu)
|
||||
if (!driver.menu || !driver.menu->menu_list)
|
||||
return -1;
|
||||
|
||||
bind = (struct retro_keybind*)setting->value.keybind;
|
||||
@ -1154,7 +1154,10 @@ static int setting_data_bind_action_ok(void *data, unsigned action)
|
||||
driver.menu->binds.last = setting->bind_type;
|
||||
driver.menu->binds.target = bind;
|
||||
driver.menu->binds.player = setting->index_offset;
|
||||
file_list_push(driver.menu->menu_stack, "", "",
|
||||
menu_list_push(
|
||||
driver.menu->menu_list->menu_stack,
|
||||
"",
|
||||
"",
|
||||
driver.menu->bind_mode_keyboard ?
|
||||
MENU_SETTINGS_CUSTOM_BIND_KEYBOARD : MENU_SETTINGS_CUSTOM_BIND,
|
||||
driver.menu->selection_ptr);
|
||||
@ -2201,10 +2204,15 @@ void setting_data_get_label(char *type_str,
|
||||
size_t type_str_size, unsigned *w, unsigned type,
|
||||
const char *menu_label, const char *label, unsigned index)
|
||||
{
|
||||
rarch_setting_t *setting_data = (rarch_setting_t*)
|
||||
driver.menu->list_settings;
|
||||
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(setting_data,
|
||||
driver.menu->selection_buf->list[index].label);
|
||||
rarch_setting_t *setting_data = NULL;
|
||||
rarch_setting_t *setting = NULL;
|
||||
|
||||
if (!driver.menu || !driver.menu->menu_list)
|
||||
return;
|
||||
|
||||
setting_data = (rarch_setting_t*)driver.menu->list_settings;
|
||||
setting = (rarch_setting_t*)setting_data_find_setting(setting_data,
|
||||
driver.menu->menu_list->selection_buf->list[index].label);
|
||||
|
||||
if ((get_fallback_label(type_str, type_str_size, w, type, menu_label,
|
||||
label, index)) == 0)
|
||||
@ -2299,10 +2307,13 @@ void setting_data_get_label(char *type_str,
|
||||
setting_data_get_string_representation(setting, type_str, type_str_size);
|
||||
else
|
||||
{
|
||||
if (!driver.menu || !driver.menu->menu_list)
|
||||
return;
|
||||
|
||||
setting_data = (rarch_setting_t*)driver.menu->list_mainmenu;
|
||||
|
||||
setting = (rarch_setting_t*)setting_data_find_setting(setting_data,
|
||||
driver.menu->selection_buf->list[index].label);
|
||||
driver.menu->menu_list->selection_buf->list[index].label);
|
||||
|
||||
if (setting)
|
||||
{
|
||||
@ -2381,11 +2392,14 @@ static void general_write_handler(void *data)
|
||||
|
||||
if (!strcmp(setting->name, "help"))
|
||||
{
|
||||
if (!driver.menu || !driver.menu->menu_list)
|
||||
return;
|
||||
|
||||
if (*setting->value.boolean)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
menu_list_push_stack_refresh(
|
||||
driver.menu->menu_stack,
|
||||
driver.menu->menu_list->menu_stack,
|
||||
"",
|
||||
"help",
|
||||
0,
|
||||
|
Loading…
Reference in New Issue
Block a user