mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[libgdx] SkeletonBinary should only set a default skin if it has attachments.
This commit is contained in:
parent
ed43c70bd1
commit
bb8cba13e1
@ -328,12 +328,18 @@ public class SkeletonBinary {
|
|||||||
return skeletonData;
|
return skeletonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return May be null. */
|
||||||
private Skin readSkin (SkeletonInput input, SkeletonData skeletonData, boolean defaultSkin, boolean nonessential)
|
private Skin readSkin (SkeletonInput input, SkeletonData skeletonData, boolean defaultSkin, boolean nonessential)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
Skin skin = new Skin(defaultSkin ? "default" : input.readStringRef());
|
Skin skin;
|
||||||
|
int slotCount;
|
||||||
if (!defaultSkin) {
|
if (defaultSkin) {
|
||||||
|
slotCount = input.readInt(true);
|
||||||
|
if (slotCount == 0) return null;
|
||||||
|
skin = new Skin("default");
|
||||||
|
} else {
|
||||||
|
skin = new Skin(input.readStringRef());
|
||||||
Object[] bones = skin.bones.setSize(input.readInt(true));
|
Object[] bones = skin.bones.setSize(input.readInt(true));
|
||||||
for (int i = 0, n = skin.bones.size; i < n; i++)
|
for (int i = 0, n = skin.bones.size; i < n; i++)
|
||||||
bones[i] = skeletonData.bones.get(input.readInt(true));
|
bones[i] = skeletonData.bones.get(input.readInt(true));
|
||||||
@ -345,9 +351,11 @@ public class SkeletonBinary {
|
|||||||
for (int i = 0, n = input.readInt(true); i < n; i++)
|
for (int i = 0, n = input.readInt(true); i < n; i++)
|
||||||
skin.constraints.add(skeletonData.pathConstraints.get(input.readInt(true)));
|
skin.constraints.add(skeletonData.pathConstraints.get(input.readInt(true)));
|
||||||
skin.constraints.shrink();
|
skin.constraints.shrink();
|
||||||
|
|
||||||
|
slotCount = input.readInt(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0, n = input.readInt(true); i < n; i++) {
|
for (int i = 0, n = slotCount; i < n; i++) {
|
||||||
int slotIndex = input.readInt(true);
|
int slotIndex = input.readInt(true);
|
||||||
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
|
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
|
||||||
String name = input.readStringRef();
|
String name = input.readStringRef();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user