aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenanse <[email protected]>2012-12-20 14:20:22 -0600
committerRenanse <[email protected]>2012-12-20 14:20:22 -0600
commit13d471de5ab4d66e1b72aae43697fb4450180985 (patch)
treea9fe55705a17e5bcf1b7dceeebd3ad2d936d6b4c
parent4b6c4a6bf432616460bbeb42f79b9e1d308055dc (diff)
Suggested tweak from Julien Gouesse
-rw-r--r--ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java11
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();
}
/**