From 85bba59541dfb59c365550433980132725d4c782 Mon Sep 17 00:00:00 2001 From: shadowislord Date: Sat, 21 Feb 2015 15:34:17 -0500 Subject: [PATCH] OgreXML: Use the placeholder texture for missing textures --- .../ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java | 4 ++-- .../scene/plugins/ogre/matext/MaterialExtensionLoader.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java index f7b027752..90840542d 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java @@ -140,7 +140,7 @@ public class MaterialLoader implements AssetLoader { textures[texUnit].setImage(loadedTexture.getImage()); textures[texUnit].setMinFilter(loadedTexture.getMinFilter()); textures[texUnit].setKey(loadedTexture.getKey()); - + // XXX: Is this really neccessary? textures[texUnit].setWrap(WrapMode.Repeat); if (texName != null){ @@ -151,7 +151,7 @@ public class MaterialLoader implements AssetLoader { } } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, matName}); - textures[texUnit].setImage(PlaceholderAssets.getPlaceholderImage()); + textures[texUnit].setImage(PlaceholderAssets.getPlaceholderImage(assetManager)); textures[texUnit].setKey(texKey); } } diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java index c430abf12..0b444b80d 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java @@ -81,7 +81,7 @@ public class MaterialExtensionLoader { tex.setWrap(WrapMode.Repeat); } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key}); - tex = new Texture2D( PlaceholderAssets.getPlaceholderImage() ); + tex = new Texture2D( PlaceholderAssets.getPlaceholderImage(assetManager) ); tex.setWrap(WrapMode.Repeat); tex.setKey(texKey); }