diff --git a/file_path_special.c b/file_path_special.c index 93f6992abb..a71da6a721 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -281,6 +281,22 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe fill_pathname_slash(s2, sizeof(s2)); strlcpy(s, s2, len); } +#endif + break; + case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG: +#ifdef HAVE_XMB + { + char s1[PATH_MAX_LENGTH] = {0}; + settings_t *settings = config_get_ptr(); + + fill_pathname_application_special(s1, sizeof(s1), + APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS); + + if (*settings->path.menu_wallpaper) + strlcpy(s, settings->path.menu_wallpaper, len); + else + fill_pathname_join(s, s1, "bg.png", len); + } #endif break; case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB: diff --git a/file_path_special.h b/file_path_special.h index cf8d620861..b853501139 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -29,6 +29,7 @@ enum application_special_type APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT, APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB, + APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT }; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index ea3034c780..9ad15a6dbb 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -383,21 +383,6 @@ static float *xmb_gradient_ident(void) } #endif -static void xmb_fill_default_background_path(xmb_handle_t *xmb, - char *path, size_t size) -{ - char iconpath[PATH_MAX_LENGTH] = {0}; - settings_t *settings = config_get_ptr(); - - fill_pathname_application_special(iconpath, sizeof(iconpath), - APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS); - - fill_pathname_join(path, iconpath, "bg.png", size); - - if (*settings->path.menu_wallpaper) - strlcpy(path, settings->path.menu_wallpaper, size); -} - static size_t xmb_list_get_selection(void *data) { xmb_handle_t *xmb = (xmb_handle_t*)data; @@ -1060,7 +1045,8 @@ static void xmb_list_switch_new(xmb_handle_t *xmb, strlcat(path, ".png", sizeof(path)); if (!path_file_exists(path)) - xmb_fill_default_background_path(xmb, path, sizeof(path)); + fill_pathname_application_special(path, sizeof(path), + APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG); if(!string_is_equal(path, xmb->background_file_path)) { @@ -2787,8 +2773,9 @@ static void xmb_context_reset(void *data) if (!xmb) return; - xmb_fill_default_background_path(xmb, - xmb->background_file_path, sizeof(xmb->background_file_path)); + fill_pathname_application_special(xmb->background_file_path, + sizeof(xmb->background_file_path), + APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG); fill_pathname_application_special(iconpath, sizeof(iconpath), APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);