static int Update(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Spine.Skeleton obj = (Spine.Skeleton)ToLua.CheckObject <Spine.Skeleton>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.Update(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Run(float incr, float endTime, TestListener listener) { Skeleton skeleton = new Skeleton(skeletonData); state.Apply(skeleton); while (time < endTime) { time += incr; skeleton.Update(incr); state.Update(incr); // Reduce float discrepancies for tests. foreach (TrackEntry entry in state.Tracks) { if (entry == null) { continue; } entry.TrackTime = Round(entry.TrackTime, 6); entry.Delay = Round(entry.Delay, 3); if (entry.MixingFrom != null) { entry.MixingFrom.TrackTime = Round(entry.MixingFrom.TrackTime, 6); } } state.Apply(skeleton); // Apply multiple times to ensure no side effects. if (expected.Count > 0) { stateListener.UnregisterFromAnimationState(state); } state.Apply(skeleton); state.Apply(skeleton); if (expected.Count > 0) { stateListener.RegisterAtAnimationState(state); } if (listener != null) { listener.Frame(time); } } state.ClearTracks(); // Expecting more than actual is a failure. for (int i = actual.Count, n = expected.Count; i < n; i++) { Log(string.Format("{0,-29}", "<none>") + "FAIL: " + expected[i]); fail = true; } actual.Clear(); expected.Clear(); Log(""); if (fail) { string message = "TEST " + test + " FAILED!"; Log(message); FailTestRun(message); } }