mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
fill_pathname_application_special - redo string concatenation for
Ozone icons - avoid fill_pathname_slash when possible and use fill_pathname_join instead - avoids the strlen cost
This commit is contained in:
parent
6dd52d9bb1
commit
bde84b926f
@ -973,8 +973,8 @@ static void rcheevos_client_fetch_game_badge(const char* badge_name, rcheevos_as
|
||||
{
|
||||
#if defined(HAVE_GFX_WIDGETS) /* don't need game badge unless widgets are enabled */
|
||||
char badge_fullpath[PATH_MAX_LENGTH] = "";
|
||||
char* badge_fullname = NULL;
|
||||
size_t badge_fullname_size = 0;
|
||||
char *badge_fullname = NULL;
|
||||
size_t badge_fullname_size = 0;
|
||||
|
||||
/* make sure the directory exists */
|
||||
fill_pathname_application_special(badge_fullpath,
|
||||
@ -988,7 +988,7 @@ static void rcheevos_client_fetch_game_badge(const char* badge_name, rcheevos_as
|
||||
}
|
||||
|
||||
fill_pathname_slash(badge_fullpath, sizeof(badge_fullpath));
|
||||
badge_fullname = badge_fullpath + strlen(badge_fullpath);
|
||||
badge_fullname = badge_fullpath + strlen(badge_fullpath);
|
||||
badge_fullname_size = sizeof(badge_fullpath) -
|
||||
(badge_fullname - badge_fullpath);
|
||||
|
||||
|
@ -264,39 +264,21 @@ void fill_pathname_application_special(char *s,
|
||||
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_OZONE_ICONS:
|
||||
#ifdef HAVE_OZONE
|
||||
{
|
||||
char tmp[PATH_MAX_LENGTH];
|
||||
char tmp2[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_assets = settings->paths.directory_assets;
|
||||
|
||||
strlcpy(s, dir_assets, len);
|
||||
fill_pathname_slash(s, len);
|
||||
|
||||
#if defined(WIIU) || defined(VITA)
|
||||
/* Smaller 46x46 icons look better on low-dpi devices */
|
||||
/* ozone */
|
||||
strlcat(s, "ozone", len);
|
||||
fill_pathname_slash(s, len);
|
||||
|
||||
/* png */
|
||||
strlcat(s, "png", len);
|
||||
fill_pathname_slash(s, len);
|
||||
|
||||
/* Icons path */
|
||||
strlcat(s, "icons", len);
|
||||
fill_pathname_slash(s, len);
|
||||
/* Smaller 46x46 icons look better on low-DPI devices */
|
||||
fill_pathname_join(tmp, dir_assets, "ozone", sizeof(tmp));
|
||||
fill_pathname_join(tmp2, "png", "icons", sizeof(tmp2));
|
||||
#else
|
||||
/* Otherwise, use large 256x256 icons */
|
||||
/* xmb */
|
||||
strlcat(s, "xmb", len);
|
||||
fill_pathname_slash(s, len);
|
||||
|
||||
/* monochrome */
|
||||
strlcat(s, "monochrome", len);
|
||||
fill_pathname_slash(s, len);
|
||||
|
||||
/* Icons path */
|
||||
strlcat(s, "png", len);
|
||||
fill_pathname_slash(s, len);
|
||||
fill_pathname_join(tmp, dir_assets, "xmb", sizeof(tmp));
|
||||
fill_pathname_join(tmp2, "monochrome", "png", sizeof(tmp2));
|
||||
#endif
|
||||
fill_pathname_join(s, tmp, tmp2, len);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user