Skip to content

Commit

Permalink
Blender TextureHelper: Make use of ImageLoader's new loadTexture capa…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
MeFisto94 authored and Nehon committed Dec 20, 2017
1 parent 3cd96b2 commit 11a647a
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,8 @@ public Texture loadImageAsTexture(Structure imageStructure, int imaflag, Blender
blenderContext.getInputStream().setPosition(dataFileBlock.getBlockPosition());

// Should the texture be flipped? It works for sinbad ..
Image img = new ImageLoader().loadImage(blenderContext.getInputStream(), dataFileBlock.getBlockPosition(), true);

if (img != null) {
result = new Texture2D(img);
} else {
result = new ImageLoader().loadTexture(blenderContext.getAssetManager(), blenderContext.getInputStream(), dataFileBlock.getBlockPosition(), true);
if (result == null) {
result = new Texture2D(PlaceholderAssets.getPlaceholderImage(blenderContext.getAssetManager()));
LOGGER.fine("ImageLoader returned null. It probably failed to load the packed texture, using placeholder asset");
}
Expand Down

0 comments on commit 11a647a

Please sign in to comment.