mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
(Ozone) Cleanup this confusing code
This commit is contained in:
parent
48ffe8dac3
commit
84f04ae984
@ -670,8 +670,7 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||
unsigned i;
|
||||
const char *title;
|
||||
char title_noext[255];
|
||||
char *chr;
|
||||
bool hyphen_found;
|
||||
char *console_name = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
|
||||
|
||||
@ -780,38 +779,38 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||
|
||||
fill_pathname_base_noext(title_noext, title, sizeof(title_noext));
|
||||
|
||||
console_name = title_noext;
|
||||
/* Format : "Vendor - Console"
|
||||
Remove everything before the hyphen
|
||||
and the subsequent space */
|
||||
chr = title_noext;
|
||||
hyphen_found = false;
|
||||
if (settings->bools.ozone_truncate_playlist_name)
|
||||
{
|
||||
bool hyphen_found = false;
|
||||
|
||||
/* TODO/FIXME - why is there a while loop here?
|
||||
* Does 'something' set ozone_truncate_playlist_name
|
||||
* ever to false while this is running? */
|
||||
while (settings->bools.ozone_truncate_playlist_name)
|
||||
while (true)
|
||||
{
|
||||
/* Check for "- " */
|
||||
if (*chr == '-' && *(chr + 1) == ' ')
|
||||
if (*console_name == '-' && *(console_name + 1) == ' ')
|
||||
{
|
||||
hyphen_found = true;
|
||||
break;
|
||||
}
|
||||
else if (*chr == '\0')
|
||||
else if (*console_name == '\0')
|
||||
break;
|
||||
|
||||
chr++;
|
||||
console_name++;
|
||||
}
|
||||
|
||||
if (hyphen_found)
|
||||
chr += 2;
|
||||
console_name += 2;
|
||||
else
|
||||
chr = title_noext;
|
||||
console_name = title_noext;
|
||||
}
|
||||
|
||||
if (node->console_name)
|
||||
free(node->console_name);
|
||||
|
||||
node->console_name = strdup(chr);
|
||||
node->console_name = strdup(console_name);
|
||||
|
||||
free(sysname);
|
||||
free(texturepath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user