mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +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 */
|
#if defined(HAVE_GFX_WIDGETS) /* don't need game badge unless widgets are enabled */
|
||||||
char badge_fullpath[PATH_MAX_LENGTH] = "";
|
char badge_fullpath[PATH_MAX_LENGTH] = "";
|
||||||
char* badge_fullname = NULL;
|
char *badge_fullname = NULL;
|
||||||
size_t badge_fullname_size = 0;
|
size_t badge_fullname_size = 0;
|
||||||
|
|
||||||
/* make sure the directory exists */
|
/* make sure the directory exists */
|
||||||
fill_pathname_application_special(badge_fullpath,
|
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));
|
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_size = sizeof(badge_fullpath) -
|
||||||
(badge_fullname - badge_fullpath);
|
(badge_fullname - badge_fullpath);
|
||||||
|
|
||||||
|
@ -264,39 +264,21 @@ void fill_pathname_application_special(char *s,
|
|||||||
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_OZONE_ICONS:
|
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_OZONE_ICONS:
|
||||||
#ifdef HAVE_OZONE
|
#ifdef HAVE_OZONE
|
||||||
{
|
{
|
||||||
|
char tmp[PATH_MAX_LENGTH];
|
||||||
|
char tmp2[PATH_MAX_LENGTH];
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char *dir_assets = settings->paths.directory_assets;
|
const char *dir_assets = settings->paths.directory_assets;
|
||||||
|
|
||||||
strlcpy(s, dir_assets, len);
|
|
||||||
fill_pathname_slash(s, len);
|
|
||||||
|
|
||||||
#if defined(WIIU) || defined(VITA)
|
#if defined(WIIU) || defined(VITA)
|
||||||
/* Smaller 46x46 icons look better on low-dpi devices */
|
/* Smaller 46x46 icons look better on low-DPI devices */
|
||||||
/* ozone */
|
fill_pathname_join(tmp, dir_assets, "ozone", sizeof(tmp));
|
||||||
strlcat(s, "ozone", len);
|
fill_pathname_join(tmp2, "png", "icons", sizeof(tmp2));
|
||||||
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);
|
|
||||||
#else
|
#else
|
||||||
/* Otherwise, use large 256x256 icons */
|
/* Otherwise, use large 256x256 icons */
|
||||||
/* xmb */
|
fill_pathname_join(tmp, dir_assets, "xmb", sizeof(tmp));
|
||||||
strlcat(s, "xmb", len);
|
fill_pathname_join(tmp2, "monochrome", "png", sizeof(tmp2));
|
||||||
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);
|
|
||||||
#endif
|
#endif
|
||||||
|
fill_pathname_join(s, tmp, tmp2, len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user