mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +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));
|
||||
try {
|
||||
skeletonData.hash = input.readString();
|
||||
if (skeletonData.hash.isEmpty()) skeletonData.hash = null;
|
||||
skeletonData.version = input.readString();
|
||||
if (skeletonData.version.isEmpty()) skeletonData.version = null;
|
||||
skeletonData.width = input.readFloat();
|
||||
skeletonData.height = input.readFloat();
|
||||
|
||||
boolean nonessential = input.readBoolean();
|
||||
|
||||
if (nonessential) {
|
||||
String imagesPath = input.readString();
|
||||
if (imagesPath.length() > 0) skeletonData.imagesPath = imagesPath;
|
||||
skeletonData.imagesPath = input.readString();
|
||||
if (skeletonData.imagesPath.isEmpty()) skeletonData.imagesPath = null;
|
||||
}
|
||||
|
||||
// Bones.
|
||||
|
||||
@ -95,10 +95,10 @@ public class SkeletonJson {
|
||||
// Skeleton.
|
||||
JsonValue skeletonMap = root.get("skeleton");
|
||||
if (skeletonMap != null) {
|
||||
skeletonData.hash = skeletonMap.getString("hash");
|
||||
skeletonData.version = skeletonMap.getString("spine");
|
||||
skeletonData.width = skeletonMap.getFloat("width");
|
||||
skeletonData.height = skeletonMap.getFloat("height");
|
||||
skeletonData.hash = skeletonMap.getString("hash", null);
|
||||
skeletonData.version = skeletonMap.getString("spine", null);
|
||||
skeletonData.width = skeletonMap.getFloat("width", 0);
|
||||
skeletonData.height = skeletonMap.getFloat("height", 0);
|
||||
skeletonData.imagesPath = skeletonMap.getString("images", null);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user