FIXED: Issue 428: Blender loader doesn't compress index buffers
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8898 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
7f694b3ba0
commit
7e3e35c7f2
@ -303,13 +303,20 @@ public class MeshHelper extends AbstractBlenderHelper {
|
||||
|
||||
// creating vertices indices for this mesh
|
||||
List<Integer> indexList = meshEntry.getValue();
|
||||
int[] indices = new int[indexList.size()];
|
||||
for (int i = 0; i < indexList.size(); ++i) {
|
||||
indices[i] = indexList.get(i).intValue();
|
||||
if(verticesAmount < Short.MAX_VALUE * 2) {
|
||||
short[] indices = new short[indexList.size()];
|
||||
for (int i = 0; i < indexList.size(); ++i) {
|
||||
indices[i] = indexList.get(i).shortValue();
|
||||
}
|
||||
mesh.setBuffer(Type.Index, 1, indices);
|
||||
} else {
|
||||
int[] indices = new int[indexList.size()];
|
||||
for (int i = 0; i < indexList.size(); ++i) {
|
||||
indices[i] = indexList.get(i).intValue();
|
||||
}
|
||||
mesh.setBuffer(Type.Index, 1, indices);
|
||||
}
|
||||
|
||||
// setting vertices
|
||||
mesh.setBuffer(Type.Index, 1, indices);
|
||||
|
||||
mesh.setBuffer(verticesBuffer);
|
||||
mesh.setBuffer(verticesBind);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user