From ea6b595036416ff5be760029e1768f85ff7e2a36 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Thu, 2 Sep 2021 00:00:32 -0600 Subject: [PATCH] [libgdx] Updated JsonRollback for older Java compilers. --- .../esotericsoftware/spine/JsonRollback.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/JsonRollback.java b/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/JsonRollback.java index 356200860..7abd29124 100644 --- a/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/JsonRollback.java +++ b/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/JsonRollback.java @@ -93,26 +93,26 @@ public class JsonRollback { rename(root, "ffd", "animations", "*", "deform"); // In 3.3 mesh is now a single type, previously they were skinnedmesh if they had weights. - for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "mesh")) + for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "mesh")) if (value.parent.get("uvs").size != value.parent.get("vertices").size) value.set("skinnedmesh"); // In 3.3 linkedmesh is now a single type, previously they were linkedweightedmesh if they had weights. - for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "linkedmesh")) { + for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "linkedmesh")) { String slot = value.parent.parent.name.replaceAll("", ""); String skinName = value.parent.getString("skin", "default"); String parentName = value.parent.getString("parent"); - if (find(root, new Array(), 0, + if (find(root, new Array(), 0, ("skins~~" + skinName + "~~" + slot + "~~" + parentName + "~~type~~skinnedmesh").split("~~")).size > 0) value.set("weightedlinkedmesh"); } // In 3.3 bounding boxes can be weighted. - for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "boundingbox")) + for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "boundingbox")) if (value.parent.getInt("vertexCount") * 2 != value.parent.get("vertices").size) value.parent.parent.remove(value.parent.name); // In 3.3 paths were added. - for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "path")) { + for (JsonValue value : find(root, new Array(), 0, "skins", "*", "*", "*", "type", "path")) { String attachment = value.parent.name; value.parent.parent.remove(attachment); String slot = value.parent.parent.name; @@ -121,7 +121,7 @@ public class JsonRollback { } // In 3.3 IK constraint timelines no longer require bendPositive. - for (JsonValue value : find(root, new Array(), 0, "animations", "*", "ik", "*")) + for (JsonValue value : find(root, new Array(), 0, "animations", "*", "ik", "*")) for (JsonValue child = value.child; child != null; child = child.next) if (!child.has("bendPositive")) child.addChild("bendPositive", new JsonValue(true)); @@ -166,7 +166,7 @@ public class JsonRollback { } static private void constraintNames (JsonValue root, String... path) { - for (JsonValue map : find(root, new Array(), 0, path)) { + for (JsonValue map : find(root, new Array(), 0, path)) { for (JsonValue constraint = map.child; constraint != null; constraint = constraint.next) { for (JsonValue child = constraint.child; child != null; child = child.next) { if (child.name.equals("mixRotate")) @@ -248,17 +248,17 @@ public class JsonRollback { } static void setValue (JsonValue root, String newValue, String... path) { - for (JsonValue value : find(root, new Array(), 0, path)) + for (JsonValue value : find(root, new Array(), 0, path)) value.set(newValue); } static void rename (JsonValue root, String newName, String... path) { - for (JsonValue value : find(root, new Array(), 0, path)) + for (JsonValue value : find(root, new Array(), 0, path)) value.name = newName; } static void delete (JsonValue root, String... path) { - for (JsonValue value : find(root, new Array(), 0, path)) + for (JsonValue value : find(root, new Array(), 0, path)) value.parent.remove(value.name); }