diff options
author | Renanse <[email protected]> | 2012-12-20 14:20:22 -0600 |
---|---|---|
committer | Renanse <[email protected]> | 2012-12-20 14:20:22 -0600 |
commit | 13d471de5ab4d66e1b72aae43697fb4450180985 (patch) | |
tree | a9fe55705a17e5bcf1b7dceeebd3ad2d936d6b4c | |
parent | 4b6c4a6bf432616460bbeb42f79b9e1d308055dc (diff) |
Suggested tweak from Julien Gouesse
-rw-r--r-- | ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java index b98c7ec..88218ea 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java @@ -346,11 +346,14 @@ public class MeshData implements Savable { * @see #setTextureCoords(FloatBufferData, int) */ public void setTextureBuffer(final FloatBuffer textureBuffer, final int index) { - while (_textureCoords.size() <= index) { - _textureCoords.add(null); + if (textureBuffer != null) { + while (_textureCoords.size() <= index) { + _textureCoords.add(null); + } + _textureCoords.set(index, new FloatBufferData(textureBuffer, 2)); + } else if (index < _textureCoords.size()) { + _textureCoords.set(index, null); } - _textureCoords.set(index, new FloatBufferData(textureBuffer, 2)); - refreshInterleaved(); } /** |