Fixed parsing animations with no bone timelines.

This commit is contained in:
NathanSweet 2013-04-05 12:02:37 +02:00
parent b947ac02b6
commit 4ea3a8a632

View File

@ -195,6 +195,7 @@ public class SkeletonJson {
float duration = 0;
OrderedMap<String, ?> bonesMap = (OrderedMap)map.get("bones");
if (bonesMap != null) {
for (Entry<String, ?> entry : bonesMap.entries()) {
String boneName = entry.key;
int boneIndex = skeletonData.findBoneIndex(boneName);
@ -233,8 +234,8 @@ public class SkeletonJson {
for (OrderedMap valueMap : values) {
float time = (Float)valueMap.get("time");
Float x = (Float)valueMap.get("x"), y = (Float)valueMap.get("y");
timeline
.setFrame(keyframeIndex, time, x == null ? 0 : (x * timelineScale), y == null ? 0 : (y * timelineScale));
timeline.setFrame(keyframeIndex, time, x == null ? 0 : (x * timelineScale), y == null ? 0
: (y * timelineScale));
readCurve(timeline, keyframeIndex, valueMap);
keyframeIndex++;
}
@ -245,6 +246,7 @@ public class SkeletonJson {
throw new RuntimeException("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
}
}
}
OrderedMap<String, ?> slotsMap = (OrderedMap)map.get("slots");
if (slotsMap != null) {