diff options
author | Julien Gouesse <[email protected]> | 2014-07-13 19:50:34 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2014-07-13 19:50:34 +0200 |
commit | 43fad9bd46c3e4c644fe39bc50dba09202fab3cf (patch) | |
tree | 3fc31470b8e41d3b769180ba68bfb0e52a58e3ac /ardor3d-extras/src/main/java | |
parent | 7d9f921b106e507341accbda3934354dca8f713d (diff) |
Does no longer use the default texture when loading a MD2 model so that the importer correctly loops on all skins
Diffstat (limited to 'ardor3d-extras/src/main/java')
-rw-r--r-- | ardor3d-extras/src/main/java/com/ardor3d/extension/model/md2/Md2Importer.java | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md2/Md2Importer.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md2/Md2Importer.java index 065a8fc..23b14f1 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md2/Md2Importer.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md2/Md2Importer.java @@ -10,7 +10,6 @@ package com.ardor3d.extension.model.md2; -import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -352,28 +351,19 @@ public class Md2Importer { } private Texture loadTexture(final String name) { - Texture tex = null; - try { - if (_textureLocator == null) { - tex = TextureManager.load(name, getMinificationFilter(), - isUseCompression() ? TextureStoreFormat.GuessCompressedFormat - : TextureStoreFormat.GuessNoCompressedFormat, isFlipTextureVertically()); - } else { - final ResourceSource source = _textureLocator.locateResource(name); - if (source != null) { - tex = TextureManager.load(source, getMinificationFilter(), - isUseCompression() ? TextureStoreFormat.GuessCompressedFormat - : TextureStoreFormat.GuessNoCompressedFormat, isFlipTextureVertically()); - } - } - } catch (final Throwable t) { - if (t instanceof IOException - && ((IOException) t).getMessage().equalsIgnoreCase("No suitable reader for given stream")) { - // silently ignores this case, the bug 982 of JOGL hasn't been fixed yet - return null; - } else { - throw new RuntimeException("Unable to load the texture from name: " + name, t); - } + final ResourceSource source; + if (_textureLocator == null) { + source = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name); + } else { + source = _textureLocator.locateResource(name); + } + final Texture tex; + if (source == null) { + tex = null; + } else { + tex = TextureManager.load(source, getMinificationFilter(), + isUseCompression() ? TextureStoreFormat.GuessCompressedFormat + : TextureStoreFormat.GuessNoCompressedFormat, isFlipTextureVertically()); } return tex; } |