* Check to ensure all buffers have the same number of components when merging.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10214 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..om 12 years ago
parent c8f1375ecc
commit cc9379b42a
  1. 6
      engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java

@ -131,6 +131,12 @@ public class GeometryBatchFactory {
} }
for (VertexBuffer vb : geom.getMesh().getBufferList().getArray()) { for (VertexBuffer vb : geom.getMesh().getBufferList().getArray()) {
int currentCompsForBuf = compsForBuf[vb.getBufferType().ordinal()];
if (currentCompsForBuf != 0 && currentCompsForBuf != vb.getNumComponents()) {
throw new UnsupportedOperationException("The geometry " + geom + " buffer " + vb.getBufferType() +
" has different number of components than the rest of the meshes " +
"(this: " + vb.getNumComponents() + ", expected: " + currentCompsForBuf + ")");
}
compsForBuf[vb.getBufferType().ordinal()] = vb.getNumComponents(); compsForBuf[vb.getBufferType().ordinal()] = vb.getNumComponents();
formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat(); formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat();
} }

Loading…
Cancel
Save