diff --git a/command.c b/command.c index 918e57d358..68393d0c06 100755 --- a/command.c +++ b/command.c @@ -1529,7 +1529,7 @@ static bool command_event_save_core_config(void) config_path[0] = '\0'; /* Infer file name based on libretro core. */ - if (!string_is_empty(core_path) && filestream_exists(core_path)) + if (path_is_valid(core_path)) { unsigned i; RARCH_LOG("%s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG)); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 3574c460bd..b1fd623c7b 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -723,7 +723,7 @@ static void xmb_draw_icon( draw.y = height - y - shadow_offset; #if defined(VITA) || defined(WIIU) - if(scale_factor < 1) + if (scale_factor < 1) { draw.x = draw.x + (icon_size-draw.width)/2; draw.y = draw.y + (icon_size-draw.width)/2; @@ -737,7 +737,7 @@ static void xmb_draw_icon( draw.y = height - y; #if defined(VITA) || defined(WIIU) - if(scale_factor < 1) + if (scale_factor < 1) { draw.x = draw.x + (icon_size-draw.width)/2; draw.y = draw.y + (icon_size-draw.width)/2; @@ -1185,8 +1185,7 @@ static void xmb_update_savestate_thumbnail_image(void *data) if (!xmb) return; - if (!string_is_empty(xmb->savestate_thumbnail_file_path) - && filestream_exists(xmb->savestate_thumbnail_file_path)) + if (path_is_valid(xmb->savestate_thumbnail_file_path)) task_push_image_load(xmb->savestate_thumbnail_file_path, menu_display_handle_savestate_thumbnail_upload, NULL); else @@ -1636,9 +1635,9 @@ static void xmb_list_switch_new(xmb_handle_t *xmb, fill_pathname_application_special(path, path_size, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG); - if(!string_is_equal(path, xmb->bg_file_path)) + if (!string_is_equal(path, xmb->bg_file_path)) { - if(filestream_exists(path)) + if (filestream_exists(path)) { task_push_image_load(path, menu_display_handle_wallpaper_upload, NULL); @@ -2044,7 +2043,7 @@ static void xmb_context_reset_horizontal_list( if (image_texture_load(&ti, texturepath)) { - if(ti.pixels) + if (ti.pixels) { video_driver_texture_unload(&node->icon); video_driver_texture_load(&ti, @@ -2072,7 +2071,7 @@ static void xmb_context_reset_horizontal_list( if (image_texture_load(&ti, content_texturepath)) { - if(ti.pixels) + if (ti.pixels) { video_driver_texture_unload(&node->content_icon); video_driver_texture_load(&ti, diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 17a1559f4a..9de34dfb68 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -1683,10 +1683,12 @@ bool menu_display_reset_textures_list( ti.pixels = NULL; ti.supports_rgba = video_driver_supports_rgba(); - if (!string_is_empty(texture_path)) - fill_pathname_join(texpath, iconpath, texture_path, sizeof(texpath)); + if (string_is_empty(texture_path)) + return false; - if (string_is_empty(texpath) || !filestream_exists(texpath)) + fill_pathname_join(texpath, iconpath, texture_path, sizeof(texpath)); + + if (!path_is_valid(texpath)) return false; if (!image_texture_load(&ti, texpath))