mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Clean up.
This commit is contained in:
parent
7a0475c499
commit
851f0b5368
@ -157,6 +157,7 @@ public class Animation {
|
|||||||
private final float[] curves; // type, x, y, ...
|
private final float[] curves; // type, x, y, ...
|
||||||
|
|
||||||
public CurveTimeline (int frameCount) {
|
public CurveTimeline (int frameCount) {
|
||||||
|
if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount);
|
||||||
curves = new float[(frameCount - 1) * BEZIER_SIZE];
|
curves = new float[(frameCount - 1) * BEZIER_SIZE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -134,13 +134,13 @@ public class SkeletonBinary {
|
|||||||
|
|
||||||
// IK constraints.
|
// IK constraints.
|
||||||
for (int i = 0, n = input.readInt(true); i < n; i++) {
|
for (int i = 0, n = input.readInt(true); i < n; i++) {
|
||||||
IkConstraintData ikConstraint = new IkConstraintData(input.readString());
|
IkConstraintData ikConstraintData = new IkConstraintData(input.readString());
|
||||||
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++)
|
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++)
|
||||||
ikConstraint.bones.add(skeletonData.bones.get(input.readInt(true)));
|
ikConstraintData.bones.add(skeletonData.bones.get(input.readInt(true)));
|
||||||
ikConstraint.target = skeletonData.bones.get(input.readInt(true));
|
ikConstraintData.target = skeletonData.bones.get(input.readInt(true));
|
||||||
ikConstraint.mix = input.readFloat();
|
ikConstraintData.mix = input.readFloat();
|
||||||
ikConstraint.bendDirection = input.readByte();
|
ikConstraintData.bendDirection = input.readByte();
|
||||||
skeletonData.ikConstraints.add(ikConstraint);
|
skeletonData.ikConstraints.add(ikConstraintData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slots.
|
// Slots.
|
||||||
@ -193,6 +193,7 @@ public class SkeletonBinary {
|
|||||||
return skeletonData;
|
return skeletonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return May be null. */
|
||||||
private Skin readSkin (DataInput input, String skinName, boolean nonessential) throws IOException {
|
private Skin readSkin (DataInput input, String skinName, boolean nonessential) throws IOException {
|
||||||
int slotCount = input.readInt(true);
|
int slotCount = input.readInt(true);
|
||||||
if (slotCount == 0) return null;
|
if (slotCount == 0) return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user