mirror of
https://github.com/libretro/RetroArch
synced 2025-02-12 00:40:26 +00:00
(Menu) Cleanups
This commit is contained in:
parent
140d0e180d
commit
c69c972942
@ -365,12 +365,12 @@ end:
|
|||||||
static int general_push(menu_displaylist_info_t *info,
|
static int general_push(menu_displaylist_info_t *info,
|
||||||
unsigned id, enum menu_displaylist_ctl_state state)
|
unsigned id, enum menu_displaylist_ctl_state state)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
char *newstring2 = NULL;
|
char *newstring2 = NULL;
|
||||||
core_info_list_t *list = NULL;
|
core_info_list_t *list = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
settings_t *settings = config_get_ptr();
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
core_info_get_list(&list);
|
core_info_get_list(&list);
|
||||||
|
@ -217,9 +217,9 @@ static int action_left_mainmenu(unsigned type, const char *label,
|
|||||||
{
|
{
|
||||||
menu_ctx_list_t list_info;
|
menu_ctx_list_t list_info;
|
||||||
unsigned push_list = 0;
|
unsigned push_list = 0;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
menu_driver_list_get_selection(&list_info);
|
menu_driver_list_get_selection(&list_info);
|
||||||
|
@ -361,11 +361,14 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
const char *content_path = NULL;
|
const char *content_path = NULL;
|
||||||
const char *info_label = NULL;
|
const char *info_label = NULL;
|
||||||
const char *info_path = NULL;
|
const char *info_path = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||||
char *menu_driver = settings->arrays.menu_driver;
|
char *menu_driver = settings->arrays.menu_driver;
|
||||||
|
|
||||||
|
if (!menu || string_is_equal(menu_driver, "null"))
|
||||||
|
goto end;
|
||||||
|
|
||||||
#ifdef HAVE_AUDIOMIXER
|
#ifdef HAVE_AUDIOMIXER
|
||||||
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_ok)
|
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_ok)
|
||||||
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
||||||
@ -375,10 +378,6 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
|
|
||||||
info.list = menu_stack;
|
info.list = menu_stack;
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu) ||
|
|
||||||
string_is_equal(menu_driver, "null"))
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
tmp[0] = parent_dir[0] = '\0';
|
tmp[0] = parent_dir[0] = '\0';
|
||||||
|
|
||||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL);
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL);
|
||||||
@ -1249,10 +1248,10 @@ static int file_load_with_detect_core_wrapper(
|
|||||||
char *new_core_path = NULL;
|
char *new_core_path = NULL;
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
core_info_list_t *list = NULL;
|
core_info_list_t *list = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1344,9 +1343,9 @@ static int action_ok_file_load_with_detect_core_carchive(
|
|||||||
const char *path,
|
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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
fill_pathname_join_delim(menu->detect_content_path,
|
fill_pathname_join_delim(menu->detect_content_path,
|
||||||
@ -1478,7 +1477,7 @@ static int generic_action_ok(const char *path,
|
|||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
const char *flush_char = NULL;
|
const char *flush_char = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
#ifdef HAVE_AUDIOMIXER
|
#ifdef HAVE_AUDIOMIXER
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
@ -1486,7 +1485,7 @@ static int generic_action_ok(const char *path,
|
|||||||
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
menu_entries_get_last_stack(&menu_path,
|
menu_entries_get_last_stack(&menu_path,
|
||||||
@ -1797,8 +1796,8 @@ static int action_ok_file_load(const char *path,
|
|||||||
/* TODO/FIXME - this path is triggered when we try to load a
|
/* TODO/FIXME - this path is triggered when we try to load a
|
||||||
* file from an archive while inside the load subsystem
|
* file from an archive while inside the load subsystem
|
||||||
* action */
|
* action */
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
fill_pathname_join(menu_path_new,
|
fill_pathname_join(menu_path_new,
|
||||||
@ -1841,8 +1840,8 @@ static int action_ok_file_load(const char *path,
|
|||||||
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN))
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
fill_pathname_join(menu_path_new,
|
fill_pathname_join(menu_path_new,
|
||||||
@ -1876,11 +1875,11 @@ static int action_ok_playlist_entry_collection(const char *path,
|
|||||||
bool playlist_initialized = false;
|
bool playlist_initialized = false;
|
||||||
playlist_t *playlist = NULL;
|
playlist_t *playlist = NULL;
|
||||||
playlist_t *tmp_playlist = NULL;
|
playlist_t *tmp_playlist = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
const struct playlist_entry *entry = NULL;
|
const struct playlist_entry *entry = NULL;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
new_path[0] = '\0';
|
new_path[0] = '\0';
|
||||||
@ -2009,14 +2008,13 @@ static int action_ok_playlist_entry(const char *path,
|
|||||||
char new_core_path[PATH_MAX_LENGTH];
|
char new_core_path[PATH_MAX_LENGTH];
|
||||||
size_t selection_ptr = 0;
|
size_t selection_ptr = 0;
|
||||||
playlist_t *playlist = playlist_get_cached();
|
playlist_t *playlist = playlist_get_cached();
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
const struct playlist_entry *entry = NULL;
|
const struct playlist_entry *entry = NULL;
|
||||||
const char *entry_label = NULL;
|
const char *entry_label = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
new_core_path[0] = '\0';
|
new_core_path[0] = '\0';
|
||||||
|
|
||||||
if (!playlist ||
|
if (!playlist || !menu)
|
||||||
!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
selection_ptr = entry_idx;
|
selection_ptr = entry_idx;
|
||||||
@ -2089,12 +2087,11 @@ static int action_ok_playlist_entry_start_content(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)
|
||||||
{
|
{
|
||||||
size_t selection_ptr = 0;
|
size_t selection_ptr = 0;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
playlist_t *playlist = playlist_get_cached();
|
playlist_t *playlist = playlist_get_cached();
|
||||||
const struct playlist_entry *entry = NULL;
|
const struct playlist_entry *entry = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if ( !playlist ||
|
if (!playlist || !menu)
|
||||||
!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
selection_ptr = menu->scratchpad.unsigned_var;
|
selection_ptr = menu->scratchpad.unsigned_var;
|
||||||
@ -2398,12 +2395,12 @@ static int action_ok_audio_add_to_mixer_and_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)
|
||||||
{
|
{
|
||||||
char combined_path[PATH_MAX_LENGTH];
|
char combined_path[PATH_MAX_LENGTH];
|
||||||
menu_handle_t *menu = NULL;
|
struct playlist_entry entry = {0};
|
||||||
struct playlist_entry entry = {0};
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
combined_path[0] = '\0';
|
combined_path[0] = '\0';
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
fill_pathname_join(combined_path, menu->scratch2_buf,
|
fill_pathname_join(combined_path, menu->scratch2_buf,
|
||||||
@ -2429,12 +2426,12 @@ static int action_ok_audio_add_to_mixer_and_collection_and_play(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)
|
||||||
{
|
{
|
||||||
char combined_path[PATH_MAX_LENGTH];
|
char combined_path[PATH_MAX_LENGTH];
|
||||||
menu_handle_t *menu = NULL;
|
struct playlist_entry entry = {0};
|
||||||
struct playlist_entry entry = {0};
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
combined_path[0] = '\0';
|
combined_path[0] = '\0';
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
fill_pathname_join(combined_path, menu->scratch2_buf,
|
fill_pathname_join(combined_path, menu->scratch2_buf,
|
||||||
@ -2956,16 +2953,16 @@ static int action_ok_core_deferred_set(const char *new_core_path,
|
|||||||
char resolved_core_path[PATH_MAX_LENGTH];
|
char resolved_core_path[PATH_MAX_LENGTH];
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH];
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
size_t selection = menu_navigation_get_selection();
|
size_t selection = menu_navigation_get_selection();
|
||||||
struct playlist_entry entry = {0};
|
struct playlist_entry entry = {0};
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
ext_name[0] = '\0';
|
ext_name[0] = '\0';
|
||||||
core_display_name[0] = '\0';
|
core_display_name[0] = '\0';
|
||||||
resolved_core_path[0] = '\0';
|
resolved_core_path[0] = '\0';
|
||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
|
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
|
||||||
@ -3087,14 +3084,14 @@ static int action_ok_load_core_deferred(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)
|
||||||
{
|
{
|
||||||
content_ctx_info_t content_info;
|
content_ctx_info_t content_info;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
content_info.argc = 0;
|
content_info.argc = 0;
|
||||||
content_info.argv = NULL;
|
content_info.argv = NULL;
|
||||||
content_info.args = NULL;
|
content_info.args = NULL;
|
||||||
content_info.environ_get = NULL;
|
content_info.environ_get = NULL;
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
if (!task_push_load_content_with_new_core_from_menu(
|
if (!task_push_load_content_with_new_core_from_menu(
|
||||||
@ -3153,11 +3150,11 @@ static int action_ok_audio_run(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)
|
||||||
{
|
{
|
||||||
char combined_path[PATH_MAX_LENGTH];
|
char combined_path[PATH_MAX_LENGTH];
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
combined_path[0] = '\0';
|
combined_path[0] = '\0';
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
fill_pathname_join(combined_path, menu->scratch2_buf,
|
fill_pathname_join(combined_path, menu->scratch2_buf,
|
||||||
@ -3503,9 +3500,9 @@ static int action_ok_file_load_imageviewer(const char *path,
|
|||||||
static int action_ok_file_load_current_core(const char *path,
|
static int action_ok_file_load_current_core(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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
return default_action_ok_load_content_with_core_from_menu(
|
return default_action_ok_load_content_with_core_from_menu(
|
||||||
@ -3516,9 +3513,9 @@ static int action_ok_file_load_detect_core(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)
|
||||||
{
|
{
|
||||||
content_ctx_info_t content_info;
|
content_ctx_info_t content_info;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
content_info.argc = 0;
|
content_info.argc = 0;
|
||||||
@ -4151,9 +4148,9 @@ default_action_ok_cmd_func(action_ok_show_wimp, CMD_EVENT_UI_COMP
|
|||||||
static int action_ok_set_core_association(const char *path,
|
static int action_ok_set_core_association(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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
return generic_action_ok_displaylist_push(path, NULL,
|
return generic_action_ok_displaylist_push(path, NULL,
|
||||||
@ -4164,9 +4161,9 @@ static int action_ok_set_core_association(const char *path,
|
|||||||
static int action_ok_reset_core_association(const char *path,
|
static int action_ok_reset_core_association(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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
if (!command_event(CMD_EVENT_RESET_CORE_ASSOCIATION,
|
if (!command_event(CMD_EVENT_RESET_CORE_ASSOCIATION,
|
||||||
@ -4251,14 +4248,17 @@ static int action_ok_add_to_favorites(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* > crc32 + db_name */
|
/* > crc32 + db_name */
|
||||||
if (menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
{
|
{
|
||||||
playlist_t *playlist_curr = playlist_get_cached();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
if (menu)
|
||||||
if (playlist_index_is_valid(playlist_curr, menu->rpl_entry_selection_ptr, content_path, core_path))
|
|
||||||
{
|
{
|
||||||
playlist_get_crc32(playlist_curr, menu->rpl_entry_selection_ptr, &crc32);
|
playlist_t *playlist_curr = playlist_get_cached();
|
||||||
playlist_get_db_name(playlist_curr, menu->rpl_entry_selection_ptr, &db_name);
|
|
||||||
|
if (playlist_index_is_valid(playlist_curr, menu->rpl_entry_selection_ptr, content_path, core_path))
|
||||||
|
{
|
||||||
|
playlist_get_crc32(playlist_curr, menu->rpl_entry_selection_ptr, &crc32);
|
||||||
|
playlist_get_db_name(playlist_curr, menu->rpl_entry_selection_ptr, &db_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4293,14 +4293,14 @@ static int action_ok_add_to_favorites(const char *path,
|
|||||||
static int action_ok_add_to_favorites_playlist(const char *path,
|
static int action_ok_add_to_favorites_playlist(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 = NULL;
|
playlist_t *playlist_curr = playlist_get_cached();
|
||||||
playlist_t *playlist_curr = playlist_get_cached();
|
|
||||||
const struct playlist_entry *entry = NULL;
|
const struct playlist_entry *entry = NULL;
|
||||||
int ret = 0;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (!playlist_curr)
|
if (!playlist_curr)
|
||||||
return 0;
|
return 0;
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
/* Read current playlist parameters */
|
/* Read current playlist parameters */
|
||||||
@ -4407,10 +4407,10 @@ static int action_ok_delete_entry(const char *path,
|
|||||||
char *def_conf_img_path = NULL;
|
char *def_conf_img_path = NULL;
|
||||||
#endif
|
#endif
|
||||||
char *def_conf_fav_path = NULL;
|
char *def_conf_fav_path = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
playlist_t *playlist = playlist_get_cached();
|
playlist_t *playlist = playlist_get_cached();
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
conf_path = playlist_get_conf_path(playlist);
|
conf_path = playlist_get_conf_path(playlist);
|
||||||
@ -4659,9 +4659,9 @@ static int action_ok_open_picker(const char *path,
|
|||||||
static int action_ok_shader_pass(const char *path,
|
static int action_ok_shader_pass(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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
menu->scratchpad.unsigned_var = type - MENU_SETTINGS_SHADER_PASS_0;
|
menu->scratchpad.unsigned_var = type - MENU_SETTINGS_SHADER_PASS_0;
|
||||||
@ -5082,9 +5082,9 @@ static int action_ok_push_downloads_dir(const char *path,
|
|||||||
int action_ok_push_filebrowser_list_dir_select(const char *path,
|
int action_ok_push_filebrowser_list_dir_select(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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
filebrowser_set_type(FILEBROWSER_SELECT_DIR);
|
filebrowser_set_type(FILEBROWSER_SELECT_DIR);
|
||||||
@ -5096,9 +5096,9 @@ int action_ok_push_filebrowser_list_dir_select(const char *path,
|
|||||||
int action_ok_push_filebrowser_list_file_select(const char *path,
|
int action_ok_push_filebrowser_list_file_select(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 = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
||||||
@ -5506,11 +5506,11 @@ static int action_ok_start_core(const char *path,
|
|||||||
static int action_ok_load_archive(const char *path,
|
static int action_ok_load_archive(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 = NULL;
|
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
const char *content_path = NULL;
|
const char *content_path = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
menu_path = menu->scratch2_buf;
|
menu_path = menu->scratch2_buf;
|
||||||
@ -5533,12 +5533,12 @@ static int action_ok_load_archive_detect_core(const char *path,
|
|||||||
menu_content_ctx_defer_info_t def_info;
|
menu_content_ctx_defer_info_t def_info;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
core_info_list_t *list = NULL;
|
core_info_list_t *list = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
const char *content_path = NULL;
|
const char *content_path = NULL;
|
||||||
char *new_core_path = NULL;
|
char *new_core_path = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
menu_path = menu->scratch2_buf;
|
menu_path = menu->scratch2_buf;
|
||||||
@ -5844,15 +5844,15 @@ static int action_ok_pl_entry_content_thumbnails(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)
|
||||||
{
|
{
|
||||||
char system[PATH_MAX_LENGTH];
|
char system[PATH_MAX_LENGTH];
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
playlist_t *playlist = playlist_get_cached();
|
playlist_t *playlist = playlist_get_cached();
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
system[0] = '\0';
|
system[0] = '\0';
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
menu_driver_get_thumbnail_system(system, sizeof(system));
|
menu_driver_get_thumbnail_system(system, sizeof(system));
|
||||||
|
@ -169,9 +169,9 @@ static int action_start_shader_action_parameter(
|
|||||||
|
|
||||||
static int action_start_shader_pass(unsigned type, const char *label)
|
static int action_start_shader_pass(unsigned type, const char *label)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
menu->scratchpad.unsigned_var = type - MENU_SETTINGS_SHADER_PASS_0;
|
menu->scratchpad.unsigned_var = type - MENU_SETTINGS_SHADER_PASS_0;
|
||||||
|
@ -66,7 +66,6 @@ enum rarch_menu_ctl_state
|
|||||||
RARCH_MENU_CTL_FIND_DRIVER,
|
RARCH_MENU_CTL_FIND_DRIVER,
|
||||||
RARCH_MENU_CTL_LIST_FREE,
|
RARCH_MENU_CTL_LIST_FREE,
|
||||||
RARCH_MENU_CTL_ENVIRONMENT,
|
RARCH_MENU_CTL_ENVIRONMENT,
|
||||||
RARCH_MENU_CTL_DRIVER_DATA_GET,
|
|
||||||
RARCH_MENU_CTL_POINTER_TAP,
|
RARCH_MENU_CTL_POINTER_TAP,
|
||||||
RARCH_MENU_CTL_POINTER_DOWN,
|
RARCH_MENU_CTL_POINTER_DOWN,
|
||||||
RARCH_MENU_CTL_POINTER_UP,
|
RARCH_MENU_CTL_POINTER_UP,
|
||||||
|
@ -5264,14 +5264,14 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
menu_ctx_displaylist_t disp_list;
|
menu_ctx_displaylist_t disp_list;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
bool load_content = true;
|
bool load_content = true;
|
||||||
bool use_filebrowser = false;
|
bool use_filebrowser = false;
|
||||||
static bool core_selected = false;
|
static bool core_selected = false;
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
disp_list.info = info;
|
disp_list.info = info;
|
||||||
|
@ -2047,14 +2047,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case RARCH_MENU_CTL_DRIVER_DATA_GET:
|
|
||||||
{
|
|
||||||
menu_handle_t **driver_data = (menu_handle_t**)data;
|
|
||||||
if (!driver_data)
|
|
||||||
return false;
|
|
||||||
*driver_data = menu_driver_data;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RARCH_MENU_CTL_SET_PENDING_QUICK_MENU:
|
case RARCH_MENU_CTL_SET_PENDING_QUICK_MENU:
|
||||||
menu_entries_flush_stack(NULL, MENU_SETTINGS);
|
menu_entries_flush_stack(NULL, MENU_SETTINGS);
|
||||||
menu_driver_pending_quick_menu = true;
|
menu_driver_pending_quick_menu = true;
|
||||||
|
@ -237,9 +237,9 @@ void cb_net_generic(retro_task_t *task,
|
|||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||||
file_transfer_t *state = (file_transfer_t*)user_data;
|
file_transfer_t *state = (file_transfer_t*)user_data;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
if (menu->core_buf)
|
if (menu->core_buf)
|
||||||
|
@ -260,13 +260,11 @@ bool menu_input_key_bind_set_mode(
|
|||||||
{
|
{
|
||||||
unsigned index_offset;
|
unsigned index_offset;
|
||||||
input_keyboard_ctx_wait_t keys;
|
input_keyboard_ctx_wait_t keys;
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
rarch_setting_t *setting = (rarch_setting_t*)data;
|
rarch_setting_t *setting = (rarch_setting_t*)data;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!setting)
|
if (!setting || !menu)
|
||||||
return false;
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
return false;
|
return false;
|
||||||
if (menu_input_key_bind_set_mode_common(state, setting) == -1)
|
if (menu_input_key_bind_set_mode_common(state, setting) == -1)
|
||||||
return false;
|
return false;
|
||||||
|
11
retroarch.c
11
retroarch.c
@ -1028,10 +1028,9 @@ unsigned menu_input_dialog_get_kb_idx(void)
|
|||||||
|
|
||||||
bool menu_input_dialog_start_search(void)
|
bool menu_input_dialog_start_search(void)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu_driver_ctl(
|
if (!menu)
|
||||||
RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
menu_input_dialog_keyboard_display = true;
|
menu_input_dialog_keyboard_display = true;
|
||||||
@ -1049,10 +1048,8 @@ bool menu_input_dialog_start_search(void)
|
|||||||
|
|
||||||
bool menu_input_dialog_start(menu_input_ctx_line_t *line)
|
bool menu_input_dialog_start(menu_input_ctx_line_t *line)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!line)
|
if (!line || !menu)
|
||||||
return false;
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
menu_input_dialog_keyboard_display = true;
|
menu_input_dialog_keyboard_display = true;
|
||||||
|
@ -1420,9 +1420,9 @@ static void task_push_to_history_list(
|
|||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
/* Set database name + checksum */
|
/* Set database name + checksum */
|
||||||
if (menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (menu)
|
||||||
{
|
{
|
||||||
playlist_t *playlist_curr = playlist_get_cached();
|
playlist_t *playlist_curr = playlist_get_cached();
|
||||||
|
|
||||||
|
@ -471,18 +471,15 @@ static void cb_task_pl_entry_thumbnail_refresh_menu(
|
|||||||
pl_thumb_handle_t *pl_thumb = NULL;
|
pl_thumb_handle_t *pl_thumb = NULL;
|
||||||
const char *thumbnail_path = NULL;
|
const char *thumbnail_path = NULL;
|
||||||
const char *left_thumbnail_path = NULL;
|
const char *left_thumbnail_path = NULL;
|
||||||
playlist_t *current_playlist = playlist_get_cached();
|
|
||||||
menu_handle_t *menu = NULL;
|
|
||||||
bool do_refresh = false;
|
bool do_refresh = false;
|
||||||
|
playlist_t *current_playlist = playlist_get_cached();
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!task)
|
if (!task)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pl_thumb = (pl_thumb_handle_t*)task->state;
|
pl_thumb = (pl_thumb_handle_t*)task->state;
|
||||||
if (!pl_thumb)
|
if (!pl_thumb || !pl_thumb->thumbnail_path_data)
|
||||||
return;
|
|
||||||
|
|
||||||
if (!pl_thumb->thumbnail_path_data)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Only refresh if current playlist hasn't changed,
|
/* Only refresh if current playlist hasn't changed,
|
||||||
@ -494,16 +491,15 @@ static void cb_task_pl_entry_thumbnail_refresh_menu(
|
|||||||
|
|
||||||
if (!current_playlist)
|
if (!current_playlist)
|
||||||
return;
|
return;
|
||||||
|
if (!menu)
|
||||||
if (string_is_empty(playlist_get_conf_path(current_playlist)))
|
|
||||||
return;
|
return;
|
||||||
|
if (string_is_empty(playlist_get_conf_path(current_playlist)))
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (((pl_thumb->list_index != menu_navigation_get_selection()) &&
|
if (((pl_thumb->list_index != menu_navigation_get_selection()) &&
|
||||||
(pl_thumb->list_index != menu->rpl_entry_selection_ptr)) ||
|
(pl_thumb->list_index != menu->rpl_entry_selection_ptr)) ||
|
||||||
!string_is_equal(pl_thumb->playlist_path, playlist_get_conf_path(current_playlist)))
|
!string_is_equal(pl_thumb->playlist_path,
|
||||||
|
playlist_get_conf_path(current_playlist)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Only refresh if left/right thumbnails did not exist
|
/* Only refresh if left/right thumbnails did not exist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user