Skip to content

Commit 5903a6b

Browse files
committed
getAnyExtensionTexture
1 parent 296e4d8 commit 5903a6b

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

core/src/com/etheller/warsmash/util/ImageUtils.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,16 @@ public final class ImageUtils {
3131
public static final String DEFAULT_ICON_PATH = "ReplaceableTextures\\CommandButtons\\BTNTemp.blp";
3232

3333
public static Texture getAnyExtensionTexture(final DataSource dataSource, final String path) {
34-
if (dataSource.has(path)) {
35-
BufferedImage image;
36-
try {
37-
final AnyExtensionImage imageInfo = getAnyExtensionImageFixRGB(dataSource, path, "texture");
38-
image = imageInfo.getImageData();
39-
if (image != null) {
40-
return ImageUtils.getTexture(image, imageInfo.isNeedsSRGBFix());
41-
}
42-
} catch (final IOException e) {
43-
return null;
34+
BufferedImage image;
35+
try {
36+
final AnyExtensionImage imageInfo = getAnyExtensionImageFixRGB(dataSource, path, "texture");
37+
image = imageInfo.getImageData();
38+
if (image != null) {
39+
return ImageUtils.getTexture(image, imageInfo.isNeedsSRGBFix());
4440
}
45-
} else {
46-
System.err.println("Missing texture " + path);
41+
} catch (final IOException e) {
42+
System.err.println("Failed to load texture image " + path+ ": " + e.getMessage());
43+
return null;
4744
}
4845
return null;
4946
}

0 commit comments

Comments
 (0)