- Fixed issue introduced in last change of Mesh write method. Hardware Skinning buffers were not properly ignored at save time in some rare cases, and were causing a crash
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10697 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
e58d47c28d
commit
93aa3cd37b
@ -1329,27 +1329,23 @@ public class Mesh implements Savable, Cloneable {
|
||||
//Removing HW skinning buffers to not save them
|
||||
VertexBuffer hwBoneIndex = null;
|
||||
VertexBuffer hwBoneWeight = null;
|
||||
if (isAnimated()) {
|
||||
hwBoneIndex = getBuffer(Type.HWBoneIndex);
|
||||
if (hwBoneIndex != null) {
|
||||
buffers.remove(Type.HWBoneIndex.ordinal());
|
||||
}
|
||||
hwBoneWeight = getBuffer(Type.HWBoneWeight);
|
||||
if (hwBoneWeight != null) {
|
||||
buffers.remove(Type.HWBoneWeight.ordinal());
|
||||
}
|
||||
hwBoneIndex = getBuffer(Type.HWBoneIndex);
|
||||
if (hwBoneIndex != null) {
|
||||
buffers.remove(Type.HWBoneIndex.ordinal());
|
||||
}
|
||||
hwBoneWeight = getBuffer(Type.HWBoneWeight);
|
||||
if (hwBoneWeight != null) {
|
||||
buffers.remove(Type.HWBoneWeight.ordinal());
|
||||
}
|
||||
|
||||
out.writeIntSavableMap(buffers, "buffers", null);
|
||||
|
||||
//restoring Hw skinning buffers.
|
||||
if (isAnimated()) {
|
||||
if (hwBoneIndex != null) {
|
||||
buffers.put(hwBoneIndex.getBufferType().ordinal(), hwBoneIndex);
|
||||
}
|
||||
if (hwBoneWeight != null) {
|
||||
buffers.put(hwBoneWeight.getBufferType().ordinal(), hwBoneWeight);
|
||||
}
|
||||
if (hwBoneIndex != null) {
|
||||
buffers.put(hwBoneIndex.getBufferType().ordinal(), hwBoneIndex);
|
||||
}
|
||||
if (hwBoneWeight != null) {
|
||||
buffers.put(hwBoneWeight.getBufferType().ordinal(), hwBoneWeight);
|
||||
}
|
||||
|
||||
out.write(lodLevels, "lodLevels", null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user