mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 05:43:34 +00:00
Get rid of menu_entries_get_at_offset
This commit is contained in:
parent
bbe46333e1
commit
003fc7ccc8
@ -414,9 +414,10 @@ static void menu_action_setting_disp_set_label_menu_file_core(
|
|||||||
const char *alt = NULL;
|
const char *alt = NULL;
|
||||||
strcpy_literal(s, "(CORE)");
|
strcpy_literal(s, "(CORE)");
|
||||||
|
|
||||||
menu_entries_get_at_offset(list, i, NULL,
|
file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL);
|
||||||
NULL, NULL, NULL, &alt);
|
alt = list->list[i].alt
|
||||||
|
? list->list[i].alt
|
||||||
|
: list->list[i].path;
|
||||||
*w = (unsigned)strlen(s);
|
*w = (unsigned)strlen(s);
|
||||||
if (alt)
|
if (alt)
|
||||||
strlcpy(s2, alt, len2);
|
strlcpy(s2, alt, len2);
|
||||||
@ -438,8 +439,10 @@ static void menu_action_setting_disp_set_label_core_updater_entry(
|
|||||||
*s = '\0';
|
*s = '\0';
|
||||||
*w = 0;
|
*w = 0;
|
||||||
|
|
||||||
menu_entries_get_at_offset(list, i, NULL,
|
file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL);
|
||||||
NULL, NULL, NULL, &alt);
|
alt = list->list[i].alt
|
||||||
|
? list->list[i].alt
|
||||||
|
: list->list[i].path;
|
||||||
|
|
||||||
if (alt)
|
if (alt)
|
||||||
strlcpy(s2, alt, len2);
|
strlcpy(s2, alt, len2);
|
||||||
@ -490,8 +493,10 @@ static void menu_action_setting_disp_set_label_core_manager_entry(
|
|||||||
*s = '\0';
|
*s = '\0';
|
||||||
*w = 0;
|
*w = 0;
|
||||||
|
|
||||||
menu_entries_get_at_offset(list, i, NULL,
|
file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL);
|
||||||
NULL, NULL, NULL, &alt);
|
alt = list->list[i].alt
|
||||||
|
? list->list[i].alt
|
||||||
|
: list->list[i].path;
|
||||||
|
|
||||||
if (alt)
|
if (alt)
|
||||||
strlcpy(s2, alt, len2);
|
strlcpy(s2, alt, len2);
|
||||||
@ -525,8 +530,10 @@ static void menu_action_setting_disp_set_label_core_lock(
|
|||||||
*s = '\0';
|
*s = '\0';
|
||||||
*w = 0;
|
*w = 0;
|
||||||
|
|
||||||
menu_entries_get_at_offset(list, i, NULL,
|
file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL);
|
||||||
NULL, NULL, NULL, &alt);
|
alt = list->list[i].alt
|
||||||
|
? list->list[i].alt
|
||||||
|
: list->list[i].path;
|
||||||
|
|
||||||
if (alt)
|
if (alt)
|
||||||
strlcpy(s2, alt, len2);
|
strlcpy(s2, alt, len2);
|
||||||
|
@ -1472,8 +1472,10 @@ static int action_bind_sublabel_core_backup_entry(
|
|||||||
const char *crc = NULL;
|
const char *crc = NULL;
|
||||||
|
|
||||||
/* crc is entered as 'alt' text */
|
/* crc is entered as 'alt' text */
|
||||||
menu_entries_get_at_offset(list, i, NULL,
|
file_list_get_at_offset(list, i, NULL, NULL, NULL, NULL);
|
||||||
NULL, NULL, NULL, &crc);
|
crc = list->list[i].alt
|
||||||
|
? list->list[i].alt
|
||||||
|
: list->list[i].path;
|
||||||
|
|
||||||
/* Set sublabel prefix */
|
/* Set sublabel prefix */
|
||||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_BACKUP_CRC), len);
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_BACKUP_CRC), len);
|
||||||
|
@ -936,8 +936,8 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
|||||||
/* If the playlist icon doesn't exist return default */
|
/* If the playlist icon doesn't exist return default */
|
||||||
|
|
||||||
if (!path_is_valid(texturepath))
|
if (!path_is_valid(texturepath))
|
||||||
fill_pathname_join_concat(texturepath, icons_path, "default",
|
fill_pathname_join_concat(texturepath, icons_path, "default",
|
||||||
".png", sizeof(texturepath));
|
".png", sizeof(texturepath));
|
||||||
|
|
||||||
ti.width = 0;
|
ti.width = 0;
|
||||||
ti.height = 0;
|
ti.height = 0;
|
||||||
@ -984,9 +984,11 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Console name */
|
/* Console name */
|
||||||
menu_entries_get_at_offset(
|
file_list_get_at_offset(
|
||||||
&ozone->horizontal_list, i,
|
&ozone->horizontal_list, i, NULL, NULL, NULL, NULL);
|
||||||
NULL, NULL, NULL, NULL, &console_name);
|
console_name = ozone->horizontal_list.list[i].alt
|
||||||
|
? ozone->horizontal_list.list[i].alt
|
||||||
|
: ozone->horizontal_list.list[i].path;
|
||||||
|
|
||||||
if (node->console_name)
|
if (node->console_name)
|
||||||
free(node->console_name);
|
free(node->console_name);
|
||||||
@ -994,8 +996,10 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
|||||||
/* Note: console_name will *always* be valid here,
|
/* Note: console_name will *always* be valid here,
|
||||||
* but provide a fallback to prevent NULL pointer
|
* but provide a fallback to prevent NULL pointer
|
||||||
* dereferencing in case of unknown errors... */
|
* dereferencing in case of unknown errors... */
|
||||||
node->console_name = strdup(
|
if (console_name)
|
||||||
console_name ? console_name : path);
|
node->console_name = strdup(console_name);
|
||||||
|
else
|
||||||
|
node->console_name = strdup(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1513,10 +1513,10 @@ static void stripes_set_title(stripes_handle_t *stripes)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
menu_entries_get_at_offset(
|
file_list_get_at_offset(
|
||||||
&stripes->horizontal_list,
|
&stripes->horizontal_list,
|
||||||
stripes->categories_selection_ptr - (stripes->system_tab_end + 1),
|
stripes->categories_selection_ptr - (stripes->system_tab_end + 1),
|
||||||
&path, NULL, NULL, NULL, NULL);
|
&path, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
return;
|
return;
|
||||||
|
@ -1881,10 +1881,9 @@ static void xmb_set_title(xmb_handle_t *xmb)
|
|||||||
{
|
{
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
|
|
||||||
menu_entries_get_at_offset(
|
file_list_get_at_offset(&xmb->horizontal_list,
|
||||||
&xmb->horizontal_list,
|
|
||||||
xmb->categories_selection_ptr - (xmb->system_tab_end + 1),
|
xmb->categories_selection_ptr - (xmb->system_tab_end + 1),
|
||||||
&path, NULL, NULL, NULL, NULL);
|
&path, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
return;
|
return;
|
||||||
|
@ -3463,9 +3463,7 @@ static unsigned menu_displaylist_parse_cores(
|
|||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
|
|
||||||
menu_entries_get_at_offset(info->list,
|
file_list_get_at_offset(info->list, i, &path, NULL, &type, NULL);
|
||||||
i, &path, NULL, &type, NULL,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (type == FILE_TYPE_CORE)
|
if (type == FILE_TYPE_CORE)
|
||||||
{
|
{
|
||||||
|
@ -179,10 +179,6 @@ size_t menu_entries_get_stack_size(size_t idx);
|
|||||||
|
|
||||||
size_t menu_entries_get_size(void);
|
size_t menu_entries_get_size(void);
|
||||||
|
|
||||||
void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
|
|
||||||
const char **path, const char **label, unsigned *file_type,
|
|
||||||
size_t *entry_idx, const char **alt);
|
|
||||||
|
|
||||||
void menu_entries_prepend(file_list_t *list,
|
void menu_entries_prepend(file_list_t *list,
|
||||||
const char *path, const char *label,
|
const char *path, const char *label,
|
||||||
enum msg_hash_enums enum_idx,
|
enum msg_hash_enums enum_idx,
|
||||||
|
20
retroarch.c
20
retroarch.c
@ -1950,8 +1950,7 @@ static int generic_menu_iterate(
|
|||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
|
|
||||||
/* Get core path */
|
/* Get core path */
|
||||||
menu_entries_get_at_offset(selection_buf, selection,
|
file_list_get_at_offset(selection_buf, selection, &path, NULL, NULL, NULL);
|
||||||
&path, NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
/* Search for specified core */
|
/* Search for specified core */
|
||||||
if (core_list && path &&
|
if (core_list && path &&
|
||||||
@ -1974,8 +1973,7 @@ static int generic_menu_iterate(
|
|||||||
core_info_ctx_find_t core_info;
|
core_info_ctx_find_t core_info;
|
||||||
|
|
||||||
/* Get core path */
|
/* Get core path */
|
||||||
menu_entries_get_at_offset(selection_buf, selection,
|
file_list_get_at_offset(selection_buf, selection, &path, NULL, NULL, NULL);
|
||||||
&path, NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
/* Search for specified core */
|
/* Search for specified core */
|
||||||
core_info.inf = NULL;
|
core_info.inf = NULL;
|
||||||
@ -2030,8 +2028,7 @@ static int generic_menu_iterate(
|
|||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
||||||
size_t selection = menu_st->selection_ptr;
|
size_t selection = menu_st->selection_ptr;
|
||||||
menu_entries_get_at_offset(selection_buf, selection,
|
file_list_get_at_offset(selection_buf, selection, NULL, NULL, &type, NULL);
|
||||||
NULL, NULL, &type, NULL, NULL);
|
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -2714,17 +2711,6 @@ static void menu_list_flush_stack(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
|
|
||||||
const char **path, const char **label, unsigned *file_type,
|
|
||||||
size_t *entry_idx, const char **alt)
|
|
||||||
{
|
|
||||||
file_list_get_at_offset(list, idx, path, label, file_type, entry_idx);
|
|
||||||
if (list && alt)
|
|
||||||
*alt = list->list[idx].alt
|
|
||||||
? list->list[idx].alt
|
|
||||||
: list->list[idx].path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* menu_entries_elem_get_first_char:
|
* menu_entries_elem_get_first_char:
|
||||||
* @list : File list handle.
|
* @list : File list handle.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user