From 11a647a3d464068681d215d0c514abe6bb50c737 Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Tue, 12 Dec 2017 16:25:23 +0100 Subject: [PATCH] Blender TextureHelper: Make use of ImageLoader's new loadTexture capability --- .../jme3/scene/plugins/blender/textures/TextureHelper.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java index 2d83dcde60..6593226fdc 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java @@ -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"); }