mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 05:39:07 +08:00
Skeleton data is optional.
This commit is contained in:
parent
74dc8062b0
commit
3b9dc8fd20
@ -108,15 +108,17 @@ public class SkeletonBinary {
|
|||||||
DataInput input = new DataInput(file.read(512));
|
DataInput input = new DataInput(file.read(512));
|
||||||
try {
|
try {
|
||||||
skeletonData.hash = input.readString();
|
skeletonData.hash = input.readString();
|
||||||
|
if (skeletonData.hash.isEmpty()) skeletonData.hash = null;
|
||||||
skeletonData.version = input.readString();
|
skeletonData.version = input.readString();
|
||||||
|
if (skeletonData.version.isEmpty()) skeletonData.version = null;
|
||||||
skeletonData.width = input.readFloat();
|
skeletonData.width = input.readFloat();
|
||||||
skeletonData.height = input.readFloat();
|
skeletonData.height = input.readFloat();
|
||||||
|
|
||||||
boolean nonessential = input.readBoolean();
|
boolean nonessential = input.readBoolean();
|
||||||
|
|
||||||
if (nonessential) {
|
if (nonessential) {
|
||||||
String imagesPath = input.readString();
|
skeletonData.imagesPath = input.readString();
|
||||||
if (imagesPath.length() > 0) skeletonData.imagesPath = imagesPath;
|
if (skeletonData.imagesPath.isEmpty()) skeletonData.imagesPath = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bones.
|
// Bones.
|
||||||
|
|||||||
@ -95,10 +95,10 @@ public class SkeletonJson {
|
|||||||
// Skeleton.
|
// Skeleton.
|
||||||
JsonValue skeletonMap = root.get("skeleton");
|
JsonValue skeletonMap = root.get("skeleton");
|
||||||
if (skeletonMap != null) {
|
if (skeletonMap != null) {
|
||||||
skeletonData.hash = skeletonMap.getString("hash");
|
skeletonData.hash = skeletonMap.getString("hash", null);
|
||||||
skeletonData.version = skeletonMap.getString("spine");
|
skeletonData.version = skeletonMap.getString("spine", null);
|
||||||
skeletonData.width = skeletonMap.getFloat("width");
|
skeletonData.width = skeletonMap.getFloat("width", 0);
|
||||||
skeletonData.height = skeletonMap.getFloat("height");
|
skeletonData.height = skeletonMap.getFloat("height", 0);
|
||||||
skeletonData.imagesPath = skeletonMap.getString("images", null);
|
skeletonData.imagesPath = skeletonMap.getString("images", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user