From 19bb3ccf35e98edd3963832cc575336897dc289c Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 28 Nov 2016 15:39:16 +0100 Subject: [PATCH] Renamed test events to 0 and 1, matching their indices. --- .../spine-libgdx-tests/assets/test/test.json | 10 +- .../spine-libgdx-tests/assets/test/test.spine | Bin 436 -> 507 bytes .../spine/AnimationStateTests.java | 108 +++++++++--------- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/spine-libgdx/spine-libgdx-tests/assets/test/test.json b/spine-libgdx/spine-libgdx-tests/assets/test/test.json index 4f6cd3105..e4d7dff06 100644 --- a/spine-libgdx/spine-libgdx-tests/assets/test/test.json +++ b/spine-libgdx/spine-libgdx-tests/assets/test/test.json @@ -1,5 +1,5 @@ { -"skeleton": { "hash": "Qw/GA2Pge/zEE/8xq3vX9lpp4Qg", "spine": "3.0.00", "width": 0, "height": 0 }, +"skeleton": { "hash": "C7XH8P2ZH7KYz8kafheHFboZI1Q", "spine": "3.5.32", "width": 0, "height": 0 }, "bones": [ { "name": "root" } ], @@ -7,17 +7,17 @@ "event": {} }, "animations": { - "events1": { + "events0": { "events": [ { "time": 0, "name": "event", "string": "0" }, - { "time": 0.4666, "name": "event", "string": "14" }, + { "time": 0.4667, "name": "event", "string": "14" }, { "time": 1, "name": "event", "string": "30" } ] }, - "events2": { + "events1": { "events": [ { "time": 0, "name": "event", "string": "0" }, - { "time": 0.4666, "name": "event", "string": "14" }, + { "time": 0.4667, "name": "event", "string": "14" }, { "time": 1, "name": "event", "string": "30" } ] } diff --git a/spine-libgdx/spine-libgdx-tests/assets/test/test.spine b/spine-libgdx/spine-libgdx-tests/assets/test/test.spine index 97538e1d25f88454678f8277e4980f68eecc9b89..0eb86773e6a0e55aad206ad403b70aae3430ce48 100644 GIT binary patch literal 507 zcmVm+6{-a2OYX^iXXc%E@0s@|+%NPCNKyiDkRc6d zdCfBoA$-u8iy}=r(C~fXNGBeKfGJ>AJ4CiXSf&vHM<6N?lLv8uNf*6d?|eqsv_M8+ zRv-)H@Yb&n@)VGn09grWNf@%Lci`1q&A!HUOfka`B~2khN#HT(p=rc9PidkQ61XT3 z#zKeGs4jAJq+A;a!vHK%)|B?yupu)b?Q%W3PXlhmp(&ZB1Oggvv-IZfZ8EY;_OINt zZ@0*uj4fB`|1ZZ~WDS1TBAaJAgb6U>;g_L@#VZd>crdiEgeUj1aI~2G&7FzZ_(nat zMQm)F=I><^0@!?}BJ9Up)c`mmn&a${M)$F_yfz@@#Fvi literal 436 zcmV;l0Zaa!Q@ct7K@`1bc6WA@O|p52Xpn&TLJ?7HHSt~8sAyp+$QDsdG!L;;;m?fSsujIRXJ$1_fM!kU&^AA_5+wh^0`g)m|;q9?15f;xL8UKlXE_;-zA- z1ZTn^nRdaUC@{!#qZ=O2<4QOUfo2u3(iLh%W{yWiYO+&!<#2!im|Kg0YDhe{ir4C$ z1l7qPSKBO=BGi(Z-}$plkEkR+2&b-pCVcFaaQdQ+kgt%m{i1LV`o3Wv4LJxxv z`zMF_LTM@cWN3R7H$%PW^DlZ^h@DLCtP+@nOCJ%Ofn^aeu~*DLD6DR--LW*>Sr}|I zCW`z1Jt&msrXs6Zw<-OBP5-Fu=XUFXlmWZSe@S7nTqy7Z)f8TdjDo&|Cl`;l=VFqJ eFTf^jl(W10TiJs;u)4l{+i1|HmQ{sLCFl(vcGmg; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AnimationStateTests.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AnimationStateTests.java index b66dccb41..4cae4af05 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AnimationStateTests.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AnimationStateTests.java @@ -127,7 +127,7 @@ public class AnimationStateTests { expect(0, "end", 1, 1.1f), // expect(0, "dispose", 1, 1.1f) // ); - state.setAnimation(0, "events1", false); + state.setAnimation(0, "events0", false); run(0.1f, 1000, null); setup("1/60 time step, dispose queued", // 2 @@ -143,17 +143,17 @@ public class AnimationStateTests { expect(0, "start", 0, 0), // expect(0, "event 0", 0, 0), // - expect(0, "event 14", 0.467f, 0.467f), // + expect(0, "event 14", 0.483f, 0.483f), // expect(0, "event 30", 1, 1), // expect(0, "complete", 1, 1), // expect(0, "end", 1, 1.017f), // expect(0, "dispose", 1, 1.017f) // ); - state.setAnimation(0, "events1", false); - state.addAnimation(0, "events2", false, 0); + state.setAnimation(0, "events0", false); state.addAnimation(0, "events1", false, 0); - state.addAnimation(0, "events2", false, 0); - state.setAnimation(0, "events1", false); + state.addAnimation(0, "events0", false, 0); + state.addAnimation(0, "events1", false, 0); + state.setAnimation(0, "events0", false); run(1 / 60f, 1000, null); setup("30 time step", // 3 @@ -165,7 +165,7 @@ public class AnimationStateTests { expect(0, "end", 30, 60), // expect(0, "dispose", 30, 60) // ); - state.setAnimation(0, "events1", false); + state.setAnimation(0, "events0", false); run(30, 1000, null); setup("1 time step", // 4 @@ -177,7 +177,7 @@ public class AnimationStateTests { expect(0, "end", 1, 2), // expect(0, "dispose", 1, 2) // ); - state.setAnimation(0, "events1", false); + state.setAnimation(0, "events0", false); run(1, 1.01f, null); setup("interrupt", // 5 @@ -211,9 +211,9 @@ public class AnimationStateTests { expect(0, "end", 1, 3.1f), // expect(0, "dispose", 1, 3.1f) // ); - state.setAnimation(0, "events1", false); - state.addAnimation(0, "events2", false, 0); + state.setAnimation(0, "events0", false); state.addAnimation(0, "events1", false, 0); + state.addAnimation(0, "events0", false, 0); run(0.1f, 4f, null); setup("interrupt with delay", // 6 @@ -234,8 +234,8 @@ public class AnimationStateTests { expect(1, "end", 1, 1.6f), // expect(1, "dispose", 1, 1.6f) // ); - state.setAnimation(0, "events1", false); - state.addAnimation(0, "events2", false, 0.5f); + state.setAnimation(0, "events0", false); + state.addAnimation(0, "events1", false, 0.5f); run(0.1f, 1000, null); setup("interrupt with delay and mix time", // 7 @@ -259,9 +259,9 @@ public class AnimationStateTests { expect(1, "end", 1, 2), // expect(1, "dispose", 1, 2) // ); - stateData.setMix("events1", "events2", 0.7f); - state.setAnimation(0, "events1", true); - state.addAnimation(0, "events2", false, 0.9f); + stateData.setMix("events0", "events1", 0.7f); + state.setAnimation(0, "events0", true); + state.addAnimation(0, "events1", false, 0.9f); run(0.1f, 1000, null); setup("animation 0 events do not fire during mix", // 8 @@ -283,8 +283,8 @@ public class AnimationStateTests { expect(1, "dispose", 1, 1.5f) // ); stateData.setDefaultMix(0.7f); - state.setAnimation(0, "events1", false); - state.addAnimation(0, "events2", false, 0.4f); + state.setAnimation(0, "events0", false); + state.addAnimation(0, "events1", false, 0.4f); run(0.1f, 1000, null); setup("event threshold, some animation 0 events fire during mix", // 9 @@ -308,9 +308,9 @@ public class AnimationStateTests { expect(1, "end", 1, 1.5f), // expect(1, "dispose", 1, 1.5f) // ); - stateData.setMix("events1", "events2", 0.7f); - state.setAnimation(0, "events1", false).setEventThreshold(0.5f); - state.addAnimation(0, "events2", false, 0.4f); + stateData.setMix("events0", "events1", 0.7f); + state.setAnimation(0, "events0", false).setEventThreshold(0.5f); + state.addAnimation(0, "events1", false, 0.4f); run(0.1f, 1000, null); setup("event threshold, all animation 0 events fire during mix", // 10 @@ -336,8 +336,8 @@ public class AnimationStateTests { expect(1, "end", 1, 1.9f), // expect(1, "dispose", 1, 1.9f) // ); - state.setAnimation(0, "events1", true).setEventThreshold(1); - state.addAnimation(0, "events2", false, 0.8f).setMixDuration(0.7f); + state.setAnimation(0, "events0", true).setEventThreshold(1); + state.addAnimation(0, "events1", false, 0.8f).setMixDuration(0.7f); run(0.1f, 1000, null); setup("looping", // 11 @@ -360,7 +360,7 @@ public class AnimationStateTests { expect(0, "complete", 4, 4), // expect(0, "event 0", 4, 4) // ); - state.setAnimation(0, "events1", true); + state.setAnimation(0, "events0", true); run(0.1f, 4, null); setup("not looping, track end past animation 0 duration", // 12 @@ -383,8 +383,8 @@ public class AnimationStateTests { expect(1, "end", 1, 3.1f), // expect(1, "dispose", 1, 3.1f) // ); - state.setAnimation(0, "events1", false); - state.addAnimation(0, "events2", false, 2); + state.setAnimation(0, "events0", false); + state.addAnimation(0, "events1", false, 2); run(0.1f, 4f, null); setup("interrupt animation after first loop complete", // 13 @@ -412,10 +412,10 @@ public class AnimationStateTests { expect(1, "end", 1, 3.1f), // expect(1, "dispose", 1, 3.1f) // ); - state.setAnimation(0, "events1", true); + state.setAnimation(0, "events0", true); run(0.1f, 6, new TestListener() { public void frame (float time) { - if (MathUtils.isEqual(time, 1.4f)) state.addAnimation(0, "events2", false, 0); + if (MathUtils.isEqual(time, 1.4f)) state.addAnimation(0, "events1", false, 0); } }); @@ -428,7 +428,7 @@ public class AnimationStateTests { expect(0, "end", 1, 1.1f), // expect(0, "dispose", 1, 1.1f) // ); - state.addAnimation(0, "events1", false, 0); + state.addAnimation(0, "events0", false, 0); run(0.1f, 1.9f, null); setup("end time beyond non-looping animation duration", // 15 @@ -440,7 +440,7 @@ public class AnimationStateTests { expect(0, "end", 9f, 9.1f), // expect(0, "dispose", 9f, 9.1f) // ); - state.setAnimation(0, "events1", false).setTrackEnd(9); + state.setAnimation(0, "events0", false).setTrackEnd(9); run(0.1f, 10, null); setup("looping with animation start", // 16 @@ -452,7 +452,7 @@ public class AnimationStateTests { expect(0, "event 30", 1.2f, 1.2f), // expect(0, "complete", 1.2f, 1.2f) // ); - entry = state.setAnimation(0, "events1", true); + entry = state.setAnimation(0, "events0", true); entry.setAnimationLast(0.6f); entry.setAnimationStart(0.6f); run(0.1f, 1.4f, null); @@ -465,7 +465,7 @@ public class AnimationStateTests { expect(0, "complete", 1.2f, 1.2f), // expect(0, "event 14", 1.5f, 1.5f) // ); - entry = state.setAnimation(0, "events1", true); + entry = state.setAnimation(0, "events0", true); entry.setAnimationStart(0.2f); entry.setAnimationLast(0.2f); entry.setAnimationEnd(0.8f); @@ -478,7 +478,7 @@ public class AnimationStateTests { expect(0, "end", 1, 1.1f), // expect(0, "dispose", 1, 1.1f) // ); - entry = state.setAnimation(0, "events1", false); + entry = state.setAnimation(0, "events0", false); entry.setAnimationStart(0.2f); entry.setAnimationLast(0.2f); entry.setAnimationEnd(0.8f); @@ -506,12 +506,12 @@ public class AnimationStateTests { expect(1, "end", 1, 1.8f), // expect(1, "dispose", 1, 1.8f) // ); - entry = state.setAnimation(0, "events1", true); + entry = state.setAnimation(0, "events0", true); entry.setAnimationStart(0.2f); entry.setAnimationLast(0.2f); entry.setAnimationEnd(0.8f); entry.setEventThreshold(1); - state.addAnimation(0, "events2", false, 0.7f).setMixDuration(0.7f); + state.addAnimation(0, "events1", false, 0.7f).setMixDuration(0.7f); run(0.1f, 20, null); setup("setAnimation with track entry mix", // 20 @@ -536,10 +536,10 @@ public class AnimationStateTests { expect(1, "end", 1, 2.1f), // expect(1, "dispose", 1, 2.1f) // ); - state.setAnimation(0, "events1", true); + state.setAnimation(0, "events0", true); run(0.1f, 1000, new TestListener() { public void frame (float time) { - if (MathUtils.isEqual(time, 1f)) state.setAnimation(0, "events2", false).setMixDuration(0.7f); + if (MathUtils.isEqual(time, 1f)) state.setAnimation(0, "events1", false).setMixDuration(0.7f); } }); @@ -570,13 +570,13 @@ public class AnimationStateTests { expect(1, "end", 1, 1.9f), // expect(1, "dispose", 1, 1.9f) // ); - state.setAnimation(0, "events1", false); // First should be ignored. - state.setAnimation(0, "events2", false); + state.setAnimation(0, "events0", false); // First should be ignored. + state.setAnimation(0, "events1", false); run(0.1f, 1000, new TestListener() { public void frame (float time) { if (MathUtils.isEqual(time, 0.8f)) { - state.setAnimation(0, "events1", false); // First should be ignored. - state.setAnimation(0, "events2", false); + state.setAnimation(0, "events0", false); // First should be ignored. + state.setAnimation(0, "events1", false); } } }); @@ -590,38 +590,38 @@ public class AnimationStateTests { expect(0, "end", 1, 6.1f), // expect(0, "dispose", 1, 6.1f) // ); - state.addAnimation(0, "events1", false, 5); + state.addAnimation(0, "events0", false, 5); run(0.1f, 10, null); setup("setAnimation during AnimationStateListener"); // 23 state.addListener(new AnimationStateListener() { public void start (TrackEntry entry) { - if (entry.getAnimation().getName().equals("events1")) state.setAnimation(1, "events2", false); + if (entry.getAnimation().getName().equals("events0")) state.setAnimation(1, "events1", false); } public void interrupt (TrackEntry entry) { - state.addAnimation(3, "events2", false, 0); + state.addAnimation(3, "events1", false, 0); } public void end (TrackEntry entry) { - if (entry.getAnimation().getName().equals("events1")) state.setAnimation(0, "events2", false); + if (entry.getAnimation().getName().equals("events0")) state.setAnimation(0, "events1", false); } public void dispose (TrackEntry entry) { - if (entry.getAnimation().getName().equals("events1")) state.setAnimation(1, "events2", false); + if (entry.getAnimation().getName().equals("events0")) state.setAnimation(1, "events1", false); } public void complete (TrackEntry entry) { - if (entry.getAnimation().getName().equals("events1")) state.setAnimation(1, "events2", false); + if (entry.getAnimation().getName().equals("events0")) state.setAnimation(1, "events1", false); } public void event (TrackEntry entry, Event event) { - if (entry.getTrackIndex() != 2) state.setAnimation(2, "events2", false); + if (entry.getTrackIndex() != 2) state.setAnimation(2, "events1", false); } }); + state.addAnimation(0, "events0", false, 0); state.addAnimation(0, "events1", false, 0); - state.addAnimation(0, "events2", false, 0); - state.setAnimation(1, "events2", false); + state.setAnimation(1, "events1", false); run(0.1f, 10, null); setup("clearTrack", // 24 @@ -631,7 +631,7 @@ public class AnimationStateTests { expect(0, "end", 0.7f, 0.7f), // expect(0, "dispose", 0.7f, 0.7f) // ); - state.addAnimation(0, "events1", false, 0); + state.addAnimation(0, "events0", false, 0); run(0.1f, 10, new TestListener() { public void frame (float time) { if (MathUtils.isEqual(time, 0.7f)) state.clearTrack(0); @@ -653,7 +653,7 @@ public class AnimationStateTests { expect(-1, "end", 0.2f, 1), // expect(-1, "dispose", 0.2f, 1) // ); - state.addAnimation(0, "events1", false, 0); + state.addAnimation(0, "events0", false, 0); run(0.1f, 10, new TestListener() { public void frame (float time) { if (MathUtils.isEqual(time, 0.7f)) state.setEmptyAnimation(0, 0); @@ -662,7 +662,7 @@ public class AnimationStateTests { setup("TrackEntry listener"); // 26 final AtomicInteger counter = new AtomicInteger(); - state.addAnimation(0, "events1", false, 0).setListener(new AnimationStateListener() { + state.addAnimation(0, "events0", false, 0).setListener(new AnimationStateListener() { public void start (TrackEntry entry) { counter.addAndGet(1 << 1); } @@ -687,9 +687,9 @@ public class AnimationStateTests { counter.addAndGet(1 << 21); } }); + state.addAnimation(0, "events0", false, 0); state.addAnimation(0, "events1", false, 0); - state.addAnimation(0, "events2", false, 0); - state.setAnimation(1, "events2", false); + state.setAnimation(1, "events1", false); run(0.1f, 10, null); if (counter.get() != 15082016) { log("TEST 26 FAILED! " + counter);