Use menu_list_get_ptr

This commit is contained in:
twinaphex 2015-06-14 04:01:21 +02:00
parent 9a77828c1c
commit f23d511a31
12 changed files with 228 additions and 188 deletions

View File

@ -20,14 +20,15 @@
static int action_bind_down_generic(unsigned type, const char *label) static int action_bind_down_generic(unsigned type, const char *label)
{ {
unsigned scroll_speed = 0; unsigned scroll_speed = 0;
menu_handle_t *menu = menu_driver_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr();
if (!menu || !nav) menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list || !nav)
return -1; return -1;
scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1; scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1;
if (menu_list_get_size(menu->menu_list) <= 0) if (menu_list_get_size(menu_list) <= 0)
return 0; return 0;
menu_navigation_increment(nav, scroll_speed); menu_navigation_increment(nav, scroll_speed);

View File

@ -21,13 +21,14 @@
static int action_info_default(unsigned type, const char *label) static int action_info_default(unsigned type, const char *label)
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return 0; return 0;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.directory_ptr = nav->selection_ptr; info.directory_ptr = nav->selection_ptr;
strlcpy(info.label, "info_screen", sizeof(info.label)); strlcpy(info.label, "info_screen", sizeof(info.label));

View File

@ -82,23 +82,23 @@ static int archive_load(void)
const char *menu_label = NULL; const char *menu_label = NULL;
const char* path = NULL; const char* path = NULL;
size_t entry_idx = 0; size_t entry_idx = 0;
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
size_t selected = menu_navigation_get_current_selection(); size_t selected = menu_navigation_get_current_selection();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
menu_list_pop_stack(menu->menu_list); menu_list_pop_stack(menu_list);
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL);
&menu_path, &menu_label, NULL, NULL);
if (menu_list_get_size(menu->menu_list) == 0) if (menu_list_get_size(menu_list) == 0)
return 0; return 0;
menu_list_get_at_offset(menu->menu_list->selection_buf, menu_list_get_at_offset(menu_list->selection_buf,
selected, &path, NULL, NULL, &entry_idx); selected, &path, NULL, NULL, &entry_idx);
ret = rarch_defer_core(global->core_info, menu_path, path, menu_label, ret = rarch_defer_core(global->core_info, menu_path, path, menu_label,
@ -114,7 +114,7 @@ static int archive_load(void)
menu_common_load_content(false); menu_common_load_content(false);
break; break;
case 0: case 0:
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = selected; info.directory_ptr = selected;
strlcpy(info.path, settings->libretro_directory, sizeof(info.path)); strlcpy(info.path, settings->libretro_directory, sizeof(info.path));

View File

@ -54,13 +54,14 @@ static int rarch_defer_core_wrapper(menu_displaylist_info_t *info,
const char *menu_label = NULL; const char *menu_label = NULL;
int ret = 0; int ret = 0;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list,
&menu_path, &menu_label, NULL, NULL); &menu_path, &menu_label, NULL, NULL);
ret = rarch_defer_core(global->core_info, ret = rarch_defer_core(global->core_info,
@ -77,7 +78,7 @@ static int rarch_defer_core_wrapper(menu_displaylist_info_t *info,
switch (hash_label) switch (hash_label)
{ {
case MENU_LABEL_COLLECTION: case MENU_LABEL_COLLECTION:
info->list = menu->menu_list->menu_stack; info->list = menu_list->menu_stack;
info->type = 0; info->type = 0;
info->directory_ptr = idx; info->directory_ptr = idx;
rdb_entry_start_game_selection_ptr = idx; rdb_entry_start_game_selection_ptr = idx;
@ -93,7 +94,7 @@ static int rarch_defer_core_wrapper(menu_displaylist_info_t *info,
} }
break; break;
case 0: case 0:
info->list = menu->menu_list->menu_stack; info->list = menu_list->menu_stack;
info->type = 0; info->type = 0;
info->directory_ptr = idx; info->directory_ptr = idx;
strlcpy(info->path, settings->libretro_directory, sizeof(info->path)); strlcpy(info->path, settings->libretro_directory, sizeof(info->path));
@ -235,13 +236,15 @@ static int action_ok_shader_pass_load(const char *path,
{ {
const char *menu_path = NULL; const char *menu_path = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
(void)menu_path; (void)menu_path;
(void)menu_list;
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, menu_list_get_last_stack(menu_list, &menu_path, NULL,
NULL, NULL); NULL, NULL);
fill_pathname_join(menu->shader->pass[hack_shader_pass].source.path, fill_pathname_join(menu->shader->pass[hack_shader_pass].source.path,
@ -250,7 +253,7 @@ static int action_ok_shader_pass_load(const char *path,
/* This will reset any changed parameters. */ /* This will reset any changed parameters. */
video_shader_resolve_parameters(NULL, menu->shader); video_shader_resolve_parameters(NULL, menu->shader);
menu_list_flush_stack(menu->menu_list, "shader_options", 0); menu_list_flush_stack(menu_list, "shader_options", 0);
return 0; return 0;
#else #else
return -1; return -1;
@ -267,11 +270,12 @@ static int action_ok_shader_pass(const char *path,
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
hack_shader_pass = type - MENU_SETTINGS_SHADER_PASS_0; hack_shader_pass = type - MENU_SETTINGS_SHADER_PASS_0;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->video.shader_dir, sizeof(info.path)); strlcpy(info.path, settings->video.shader_dir, sizeof(info.path));
@ -285,10 +289,12 @@ static int action_ok_shader_parameters(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = MENU_SETTING_ACTION; info.type = MENU_SETTING_ACTION;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.label, label, sizeof(info.label)); strlcpy(info.label, label, sizeof(info.label));
@ -301,14 +307,16 @@ static int action_ok_push_generic_list(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
if (path) if (path)
strlcpy(menu->deferred_path, path, strlcpy(menu->deferred_path, path,
sizeof(menu->deferred_path)); sizeof(menu->deferred_path));
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.label, label, sizeof(info.label)); strlcpy(info.label, label, sizeof(info.label));
@ -321,10 +329,12 @@ static int action_ok_push_default(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, label, sizeof(info.path)); strlcpy(info.path, label, sizeof(info.path));
@ -339,11 +349,12 @@ static int action_ok_shader_preset(const char *path,
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->video.shader_dir, sizeof(info.path)); strlcpy(info.path, settings->video.shader_dir, sizeof(info.path));
@ -358,11 +369,12 @@ static int action_ok_push_content_list(const char *path,
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = MENU_FILE_DIRECTORY; info.type = MENU_FILE_DIRECTORY;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->menu_content_directory, sizeof(info.path)); strlcpy(info.path, settings->menu_content_directory, sizeof(info.path));
@ -377,11 +389,12 @@ static int action_ok_disk_image_append_list(const char *path,
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->menu_content_directory, sizeof(info.path)); strlcpy(info.path, settings->menu_content_directory, sizeof(info.path));
@ -397,10 +410,11 @@ static int action_ok_configurations_list(const char *path,
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
const char *dir = settings->menu_config_directory; const char *dir = settings->menu_config_directory;
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
if (dir) if (dir)
@ -417,11 +431,12 @@ static int action_ok_cheat_file(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->cheat_database, sizeof(info.path)); strlcpy(info.path, settings->cheat_database, sizeof(info.path));
@ -435,11 +450,12 @@ static int action_ok_audio_dsp_plugin(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->audio.filter_dir, sizeof(info.path)); strlcpy(info.path, settings->audio.filter_dir, sizeof(info.path));
@ -452,12 +468,14 @@ static int action_ok_video_filter(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->video.filter_dir, sizeof(info.path)); strlcpy(info.path, settings->video.filter_dir, sizeof(info.path));
@ -473,6 +491,7 @@ static int action_ok_core_updater_list(const char *path,
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
@ -494,7 +513,7 @@ static int action_ok_core_updater_list(const char *path,
true); true);
#endif #endif
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, path, sizeof(info.path)); strlcpy(info.path, path, sizeof(info.path));
@ -507,12 +526,13 @@ static int action_ok_remap_file(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->input_remapping_directory, sizeof(info.path)); strlcpy(info.path, settings->input_remapping_directory, sizeof(info.path));
@ -526,12 +546,13 @@ static int action_ok_record_configfile(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, global->record.config_dir, sizeof(info.path)); strlcpy(info.path, global->record.config_dir, sizeof(info.path));
@ -543,13 +564,14 @@ static int action_ok_record_configfile(const char *path,
static int action_ok_playlist_collection(const char *path, static int action_ok_playlist_collection(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
menu_handle_t *menu = menu_driver_get_ptr();
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, path, sizeof(info.path)); strlcpy(info.path, path, sizeof(info.path));
@ -563,12 +585,13 @@ static int action_ok_content_collection_list(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->playlist_directory, sizeof(info.path)); strlcpy(info.path, settings->playlist_directory, sizeof(info.path));
@ -582,12 +605,13 @@ static int action_ok_core_list(const char *path,
{ {
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, settings->libretro_directory, sizeof(info.path)); strlcpy(info.path, settings->libretro_directory, sizeof(info.path));
@ -602,15 +626,17 @@ static int action_ok_record_configfile_load(const char *path,
const char *menu_path = NULL; const char *menu_path = NULL;
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu || !global) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !global || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, menu_list_get_last_stack(menu_list, &menu_path, NULL,
NULL, NULL); NULL, NULL);
fill_pathname_join(global->record.config, menu_path, path, sizeof(global->record.config)); fill_pathname_join(global->record.config, menu_path, path, sizeof(global->record.config));
menu_list_flush_stack(menu->menu_list, "Recording Settings", 0); menu_list_flush_stack(menu_list, "Recording Settings", 0);
return 0; return 0;
} }
@ -620,19 +646,20 @@ static int action_ok_remap_file_load(const char *path,
const char *menu_path = NULL; const char *menu_path = NULL;
char remap_path[PATH_MAX_LENGTH] = {0}; char remap_path[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
(void)remap_path; (void)remap_path;
(void)menu_path; (void)menu_path;
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, menu_list_get_last_stack(menu_list, &menu_path, NULL,
NULL, NULL); NULL, NULL);
fill_pathname_join(remap_path, menu_path, path, sizeof(remap_path)); fill_pathname_join(remap_path, menu_path, path, sizeof(remap_path));
input_remapping_load_file(remap_path); input_remapping_load_file(remap_path);
menu_list_flush_stack(menu->menu_list, "core_input_remapping_options", 0); menu_list_flush_stack(menu_list, "core_input_remapping_options", 0);
return 0; return 0;
} }
@ -643,6 +670,7 @@ static int action_ok_video_filter_file_load(const char *path,
const char *menu_path = NULL; const char *menu_path = NULL;
char filter_path[PATH_MAX_LENGTH] = {0}; char filter_path[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu)
@ -651,7 +679,7 @@ static int action_ok_video_filter_file_load(const char *path,
(void)filter_path; (void)filter_path;
(void)menu_path; (void)menu_path;
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, menu_list_get_last_stack(menu_list, &menu_path, NULL,
NULL, NULL); NULL, NULL);
fill_pathname_join(filter_path, menu_path, path, sizeof(filter_path)); fill_pathname_join(filter_path, menu_path, path, sizeof(filter_path));
@ -661,7 +689,7 @@ static int action_ok_video_filter_file_load(const char *path,
event_command(EVENT_CMD_REINIT); event_command(EVENT_CMD_REINIT);
menu_list_flush_stack(menu->menu_list, "video_options", 0); menu_list_flush_stack(menu_list, "video_options", 0);
return 0; return 0;
} }
@ -672,13 +700,14 @@ static int action_ok_cheat_file_load(const char *path,
const char *menu_path = NULL; const char *menu_path = NULL;
char cheat_path[PATH_MAX_LENGTH] = {0}; char cheat_path[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
if (!menu) if (!menu)
return -1; return -1;
(void)cheat_path; (void)cheat_path;
(void)menu_path; (void)menu_path;
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, menu_list_get_last_stack(menu_list, &menu_path, NULL,
NULL, NULL); NULL, NULL);
fill_pathname_join(cheat_path, menu_path, path, sizeof(cheat_path)); fill_pathname_join(cheat_path, menu_path, path, sizeof(cheat_path));
@ -691,7 +720,7 @@ static int action_ok_cheat_file_load(const char *path,
if (!global->cheat) if (!global->cheat)
return -1; return -1;
menu_list_flush_stack(menu->menu_list, "core_cheat_options", 0); menu_list_flush_stack(menu_list, "core_cheat_options", 0);
return 0; return 0;
} }
@ -704,11 +733,13 @@ static int action_ok_menu_wallpaper_load(const char *path,
const char *menu_path = NULL; const char *menu_path = NULL;
rarch_setting_t *setting = NULL; rarch_setting_t *setting = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu)
if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, &menu_path, &menu_label, menu_list_get_last_stack(menu_list, &menu_path, &menu_label,
NULL, NULL); NULL, NULL);
setting = menu_setting_find(menu_label); setting = menu_setting_find(menu_label);
@ -726,7 +757,7 @@ static int action_ok_menu_wallpaper_load(const char *path,
true); true);
} }
menu_list_pop_stack_by_needle(menu->menu_list, setting->name); menu_list_pop_stack_by_needle(menu_list, setting->name);
return 0; return 0;
} }
@ -737,20 +768,23 @@ static int action_ok_shader_preset_load(const char *path,
const char *menu_path = NULL; const char *menu_path = NULL;
char shader_path[PATH_MAX_LENGTH] = {0}; char shader_path[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
(void)shader_path; (void)shader_path;
(void)menu_path; (void)menu_path;
(void)menu_list;
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, menu_list_get_last_stack(menu_list, &menu_path, NULL,
NULL, NULL); NULL, NULL);
fill_pathname_join(shader_path, menu_path, path, sizeof(shader_path)); fill_pathname_join(shader_path, menu_path, path, sizeof(shader_path));
menu_shader_manager_set_preset(menu->shader, menu_shader_manager_set_preset(menu->shader,
video_shader_parse_type(shader_path, RARCH_SHADER_NONE), video_shader_parse_type(shader_path, RARCH_SHADER_NONE),
shader_path); shader_path);
menu_list_flush_stack(menu->menu_list, "shader_options", 0); menu_list_flush_stack(menu_list, "shader_options", 0);
return 0; return 0;
#else #else
return -1; return -1;
@ -852,7 +886,8 @@ static int action_ok_core_deferred_set(const char *path,
{ {
char core_display_name[PATH_MAX_LENGTH] = {0}; char core_display_name[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
rarch_assert(menu->playlist != NULL); rarch_assert(menu->playlist != NULL);
@ -869,7 +904,7 @@ static int action_ok_core_deferred_set(const char *path,
content_playlist_write_file(menu->playlist); content_playlist_write_file(menu->playlist);
menu_list_pop_stack(menu->menu_list); menu_list_pop_stack(menu_list);
return -1; return -1;
} }
@ -906,13 +941,14 @@ static int action_ok_rdb_entry(const char *path,
char tmp[PATH_MAX_LENGTH] = {0}; char tmp[PATH_MAX_LENGTH] = {0};
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
strlcpy(tmp, "deferred_rdb_entry_detail|", sizeof(tmp)); strlcpy(tmp, "deferred_rdb_entry_detail|", sizeof(tmp));
strlcat(tmp, path, sizeof(tmp)); strlcat(tmp, path, sizeof(tmp));
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, label, sizeof(info.path)); strlcpy(info.path, label, sizeof(info.path));
@ -932,21 +968,22 @@ static int action_ok_core_load(const char *path,
{ {
const char *menu_path = NULL; const char *menu_path = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
(void)global; (void)global;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list,
&menu_path, NULL, NULL, NULL); &menu_path, NULL, NULL, NULL);
fill_pathname_join(settings->libretro, menu_path, path, fill_pathname_join(settings->libretro, menu_path, path,
sizeof(settings->libretro)); sizeof(settings->libretro));
event_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
menu_list_pop_stack(menu->menu_list); menu_list_pop_stack(menu_list);
#if defined(HAVE_DYNAMIC) #if defined(HAVE_DYNAMIC)
/* No content needed for this core, load core immediately. */ /* No content needed for this core, load core immediately. */
@ -997,18 +1034,16 @@ static int action_ok_directory_push(const char *path,
const char *menu_label = NULL; const char *menu_label = NULL;
char cat_path[PATH_MAX_LENGTH] = {0}; char cat_path[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list || !path)
return -1; return -1;
if (!path) menu_list_get_last_stack(menu_list,
return -1;
menu_list_get_last_stack(menu->menu_list,
&menu_path, &menu_label, NULL, NULL); &menu_path, &menu_label, NULL, NULL);
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path)); fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, cat_path, sizeof(info.path)); strlcpy(info.path, cat_path, sizeof(info.path));
@ -1023,19 +1058,16 @@ static int action_ok_database_manager_list(const char *path,
char rdb_path[PATH_MAX_LENGTH] = {0}; char rdb_path[PATH_MAX_LENGTH] = {0};
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (!menu) if (!menu || !menu_list || !path || !label)
return -1;
if (!path)
return -1;
if (!label)
return -1; return -1;
fill_pathname_join(rdb_path, settings->content_database, fill_pathname_join(rdb_path, settings->content_database,
path, sizeof(rdb_path)); path, sizeof(rdb_path));
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, rdb_path, sizeof(info.path)); strlcpy(info.path, rdb_path, sizeof(info.path));
@ -1049,16 +1081,17 @@ static int action_ok_cursor_manager_list(const char *path,
{ {
char cursor_path[PATH_MAX_LENGTH] = {0}; char cursor_path[PATH_MAX_LENGTH] = {0};
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
fill_pathname_join(cursor_path, settings->cursor_directory, fill_pathname_join(cursor_path, settings->cursor_directory,
path, sizeof(cursor_path)); path, sizeof(cursor_path));
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, cursor_path, sizeof(info.path)); strlcpy(info.path, cursor_path, sizeof(info.path));
@ -1072,17 +1105,17 @@ static int action_ok_config_load(const char *path,
{ {
const char *menu_path = NULL; const char *menu_path = NULL;
char config[PATH_MAX_LENGTH] = {0}; char config[PATH_MAX_LENGTH] = {0};
menu_handle_t *menu = menu_driver_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list, &menu_path, NULL, NULL, NULL);
&menu_path, NULL, NULL, NULL);
fill_pathname_join(config, menu_path, path, sizeof(config)); fill_pathname_join(config, menu_path, path, sizeof(config));
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS); menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
menu->msg_force = true; menu->msg_force = true;
if (rarch_replace_config(config)) if (rarch_replace_config(config))
{ {
@ -1099,19 +1132,19 @@ static int action_ok_disk_image_append(const char *path,
char image[PATH_MAX_LENGTH] = {0}; char image[PATH_MAX_LENGTH] = {0};
const char *menu_path = NULL; const char *menu_path = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list, &menu_path, NULL, NULL, NULL);
&menu_path, NULL, NULL, NULL);
fill_pathname_join(image, menu_path, path, sizeof(image)); fill_pathname_join(image, menu_path, path, sizeof(image));
event_disk_control_append_image(image); event_disk_control_append_image(image);
event_command(EVENT_CMD_RESUME); event_command(EVENT_CMD_RESUME);
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS); menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
return -1; return -1;
} }
@ -1122,13 +1155,14 @@ static int action_ok_file_load(const char *path,
const char *menu_label = NULL; const char *menu_label = NULL;
const char *menu_path = NULL; const char *menu_path = NULL;
rarch_setting_t *setting = NULL; rarch_setting_t *setting = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last(menu->menu_list->menu_stack, menu_list_get_last(menu_list->menu_stack,
&menu_path, &menu_label, NULL, NULL); &menu_path, &menu_label, NULL, NULL);
setting = menu_setting_find(menu_label); setting = menu_setting_find(menu_label);
@ -1136,7 +1170,7 @@ static int action_ok_file_load(const char *path,
if (setting && setting->type == ST_PATH) if (setting && setting->type == ST_PATH)
{ {
menu_action_setting_set_current_string_path(setting, menu_path, path); menu_action_setting_set_current_string_path(setting, menu_path, path);
menu_list_pop_stack_by_needle(menu->menu_list, setting->name); menu_list_pop_stack_by_needle(menu_list, setting->name);
} }
else else
{ {
@ -1162,11 +1196,12 @@ static int action_ok_set_path(const char *path,
const char *menu_label = NULL; const char *menu_label = NULL;
rarch_setting_t *setting = NULL; rarch_setting_t *setting = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list,
&menu_path, &menu_label, NULL, NULL); &menu_path, &menu_label, NULL, NULL);
setting = menu_setting_find(menu_label); setting = menu_setting_find(menu_label);
@ -1175,7 +1210,7 @@ static int action_ok_set_path(const char *path,
return -1; return -1;
menu_action_setting_set_current_string_path(setting, menu_path, path); menu_action_setting_set_current_string_path(setting, menu_path, path);
menu_list_pop_stack_by_needle(menu->menu_list, setting->name); menu_list_pop_stack_by_needle(menu_list, setting->name);
return 0; return 0;
} }
@ -1186,13 +1221,14 @@ static int action_ok_custom_viewport(const char *path,
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
int ret = 0; int ret = 0;
video_viewport_t *custom = video_viewport_get_custom(); video_viewport_t *custom = video_viewport_get_custom();
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list)
return -1; return -1;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = MENU_SETTINGS_CUSTOM_VIEWPORT; info.type = MENU_SETTINGS_CUSTOM_VIEWPORT;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.label, "custom_viewport_1", sizeof(info.label)); strlcpy(info.label, "custom_viewport_1", sizeof(info.label));
@ -1344,11 +1380,9 @@ static int action_ok_rdb_entry_submenu(const char *path,
struct string_list *str_list = NULL; struct string_list *str_list = NULL;
struct string_list *str_list2 = NULL; struct string_list *str_list2 = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu) if (!menu || !menu_list || !label)
return -1;
if (!label)
return -1; return -1;
str_list = string_split(label, "|"); str_list = string_split(label, "|");
@ -1390,7 +1424,7 @@ static int action_ok_rdb_entry_submenu(const char *path,
strlcpy(new_label, "deferred_cursor_manager_list_", sizeof(new_label)); strlcpy(new_label, "deferred_cursor_manager_list_", sizeof(new_label));
strlcat(new_label, str_list->elems[0].data, sizeof(new_label)); strlcat(new_label, str_list->elems[0].data, sizeof(new_label));
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = 0; info.type = 0;
info.directory_ptr = idx; info.directory_ptr = idx;
strlcpy(info.path, rdb, sizeof(info.path)); strlcpy(info.path, rdb, sizeof(info.path));

View File

@ -27,11 +27,11 @@ static int action_scan_file(const char *path,
const char *menu_label = NULL; const char *menu_label = NULL;
const char *menu_path = NULL; const char *menu_path = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL);
&menu_path, &menu_label, NULL, NULL);
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath)); fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));
@ -46,11 +46,11 @@ static int action_scan_directory(const char *path,
const char *menu_label = NULL; const char *menu_label = NULL;
const char *menu_path = NULL; const char *menu_path = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL);
&menu_path, &menu_label, NULL, NULL);
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath)); fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));

View File

@ -19,14 +19,15 @@
static int action_bind_up_generic(unsigned type, const char *label) static int action_bind_up_generic(unsigned type, const char *label)
{ {
unsigned scroll_speed = 0; unsigned scroll_speed = 0;
menu_handle_t *menu = menu_driver_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr();
if (!menu) menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return -1; return -1;
scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1; scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1;
if (menu_list_get_size(menu->menu_list) <= 0) if (menu_list_get_size(menu_list) <= 0)
return 0; return 0;
menu_navigation_decrement(nav, scroll_speed); menu_navigation_decrement(nav, scroll_speed);

View File

@ -128,6 +128,7 @@ static void rmenu_render(void)
char title_buf[256] = {0}; char title_buf[256] = {0};
char title_msg[64] = {0}; char title_msg[64] = {0};
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
uint64_t frame_count = video_driver_get_frame_count(); uint64_t frame_count = video_driver_get_frame_count();
@ -150,7 +151,7 @@ static void rmenu_render(void)
menu->animation_is_active = false; menu->animation_is_active = false;
menu->label.is_updated = false; menu->label.is_updated = false;
if (!menu->menu_list->selection_buf) if (!menu_list->selection_buf)
return; return;
begin = (nav->selection_ptr >= (ENTRIES_HEIGHT / 2)) ? begin = (nav->selection_ptr >= (ENTRIES_HEIGHT / 2)) ?

View File

@ -235,13 +235,14 @@ static size_t xmb_list_get_size(void *data, menu_list_type_t type)
{ {
size_t list_size = 0; size_t list_size = 0;
menu_handle_t *menu = (menu_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
menu_list_t *menu_list = menu ? menu->menu_list : NULL;
xmb_handle_t *xmb = menu ? (xmb_handle_t*)menu->userdata : NULL; xmb_handle_t *xmb = menu ? (xmb_handle_t*)menu->userdata : NULL;
switch (type) switch (type)
{ {
case MENU_LIST_PLAIN: case MENU_LIST_PLAIN:
if (menu && menu->menu_list) if (menu_list)
list_size = menu_list_get_stack_size(menu->menu_list); list_size = menu_list_get_stack_size(menu_list);
break; break;
case MENU_LIST_HORIZONTAL: case MENU_LIST_HORIZONTAL:
if (xmb && xmb->horizontal_list) if (xmb && xmb->horizontal_list)

View File

@ -133,12 +133,13 @@ bool menu_load_content(void)
void menu_common_load_content(bool persist) void menu_common_load_content(bool persist)
{ {
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
return; return;
event_command(persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT); event_command(persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT);
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS); menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
menu->msg_force = true; menu->msg_force = true;
} }

View File

@ -54,15 +54,13 @@ void menu_cbs_init(void *data,
struct string_list *str_list = NULL; struct string_list *str_list = NULL;
const char *menu_label = NULL; const char *menu_label = NULL;
menu_file_list_cbs_t *cbs = NULL; menu_file_list_cbs_t *cbs = NULL;
file_list_t *list = (file_list_t*)data;
menu_handle_t *menu = menu_driver_get_ptr();
int ret = 0; int ret = 0;
uint32_t label_hash = 0; uint32_t label_hash = 0;
uint32_t menu_label_hash = 0; uint32_t menu_label_hash = 0;
if (!menu) file_list_t *list = (file_list_t*)data;
return; menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!list) if (!menu || !menu_list || !list)
return; return;
cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(list, idx); cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(list, idx);
@ -70,8 +68,7 @@ void menu_cbs_init(void *data,
if (!cbs) if (!cbs)
return; return;
menu_list_get_last_stack(menu->menu_list, menu_list_get_last_stack(menu_list, NULL, &menu_label, NULL, NULL);
NULL, &menu_label, NULL, NULL);
if (label) if (label)
str_list = string_split(label, "|"); str_list = string_split(label, "|");

View File

@ -1559,6 +1559,7 @@ static int menu_displaylist_parse_generic(menu_displaylist_info_t *info, bool *n
struct string_list *str_list = NULL; struct string_list *str_list = NULL;
int device = 0; int device = 0;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
uint32_t hash_label = djb2_calculate(info->label); uint32_t hash_label = djb2_calculate(info->label);
@ -1707,7 +1708,7 @@ static int menu_displaylist_parse_generic(menu_displaylist_info_t *info, bool *n
{ {
const char *dir = NULL; const char *dir = NULL;
menu_list_get_last_stack(menu->menu_list, &dir, NULL, NULL, NULL); menu_list_get_last_stack(menu_list, &dir, NULL, NULL, NULL);
list_size = file_list_get_size(info->list); list_size = file_list_get_size(info->list);
@ -2120,12 +2121,12 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
int menu_displaylist_push(file_list_t *list, file_list_t *menu_list) int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
{ {
menu_file_list_cbs_t *cbs = NULL; menu_file_list_cbs_t *cbs = NULL;
unsigned type = 0;
const char *path = NULL; const char *path = NULL;
const char *label = NULL; const char *label = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
menu_displaylist_info_t info = {0};
uint32_t hash_label = 0; uint32_t hash_label = 0;
unsigned type = 0;
menu_displaylist_info_t info = {0};
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_get_last_stack(menu->menu_list, &path, &label, &type, NULL); menu_list_get_last_stack(menu->menu_list, &path, &label, &type, NULL);

View File

@ -403,6 +403,7 @@ static int menu_input_set_bind_mode_common(rarch_setting_t *setting,
struct retro_keybind *keybind = NULL; struct retro_keybind *keybind = NULL;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
menu_input_t *menu_input = menu_input_get_ptr(); menu_input_t *menu_input = menu_input_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr();
@ -424,7 +425,7 @@ static int menu_input_set_bind_mode_common(rarch_setting_t *setting,
menu_input->binds.target = keybind; menu_input->binds.target = keybind;
menu_input->binds.user = setting->index_offset; menu_input->binds.user = setting->index_offset;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD;
info.directory_ptr = nav->selection_ptr; info.directory_ptr = nav->selection_ptr;
strlcpy(info.label, "custom_bind", sizeof(info.label)); strlcpy(info.label, "custom_bind", sizeof(info.label));
@ -437,7 +438,7 @@ static int menu_input_set_bind_mode_common(rarch_setting_t *setting,
menu_input->binds.begin = MENU_SETTINGS_BIND_BEGIN; menu_input->binds.begin = MENU_SETTINGS_BIND_BEGIN;
menu_input->binds.last = MENU_SETTINGS_BIND_LAST; menu_input->binds.last = MENU_SETTINGS_BIND_LAST;
info.list = menu->menu_list->menu_stack; info.list = menu_list->menu_stack;
info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD;
info.directory_ptr = nav->selection_ptr; info.directory_ptr = nav->selection_ptr;
strlcpy(info.label, "custom_bind_all", sizeof(info.label)); strlcpy(info.label, "custom_bind_all", sizeof(info.label));
@ -884,6 +885,7 @@ static int menu_input_pointer_post_iterate(menu_file_list_cbs_t *cbs,
{ {
int ret = 0; int ret = 0;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
menu_input_t *menu_input = menu_input_get_ptr(); menu_input_t *menu_input = menu_input_get_ptr();
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -925,8 +927,8 @@ static int menu_input_pointer_post_iterate(menu_file_list_cbs_t *cbs,
if (!menu_input->pointer.dragging) if (!menu_input->pointer.dragging)
{ {
if (menu_input->pointer.start_y < menu->header_height) if (menu_input->pointer.start_y < menu->header_height)
menu_list_pop_stack(menu->menu_list); menu_list_pop_stack(menu_list);
else if (menu_input->pointer.ptr <= menu_list_get_size(menu->menu_list)-1) else if (menu_input->pointer.ptr <= menu_list_get_size(menu_list)-1)
{ {
menu_input->pointer.oldpressed[0] = false; menu_input->pointer.oldpressed[0] = false;
ret = pointer_tap(cbs, entry, action); ret = pointer_tap(cbs, entry, action);
@ -949,7 +951,7 @@ static int menu_input_pointer_post_iterate(menu_file_list_cbs_t *cbs,
if (!menu_input->pointer.oldback) if (!menu_input->pointer.oldback)
{ {
menu_input->pointer.oldback = true; menu_input->pointer.oldback = true;
menu_list_pop_stack(menu->menu_list); menu_list_pop_stack(menu_list);
} }
} }
menu_input->pointer.oldback = menu_input->pointer.back; menu_input->pointer.oldback = menu_input->pointer.back;