From 01c0e1881f78b16f872fa2b6797eb6edbeee6c0a Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Wed, 21 May 2014 22:28:50 +0200 Subject: [PATCH] Minor changes. --- spine-c/src/spine/Animation.c | 3 +-- spine-csharp/src/Animation.cs | 3 +-- spine-libgdx/src/com/esotericsoftware/spine/Animation.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/spine-c/src/spine/Animation.c b/spine-c/src/spine/Animation.c index 89db633d4..74fa9bfc9 100644 --- a/spine-c/src/spine/Animation.c +++ b/spine-c/src/spine/Animation.c @@ -404,8 +404,6 @@ void _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f if (time < self->frames[0]) return; /* Time is before first frame. */ - slot = skeleton->slots[self->slotIndex]; - if (time >= self->frames[self->framesCount - 5]) { /* Time is after last frame. */ int i = self->framesCount - 1; @@ -429,6 +427,7 @@ void _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f b = lastFrameB + (self->frames[frameIndex + COLOR_FRAME_B] - lastFrameB) * percent; a = lastFrameA + (self->frames[frameIndex + COLOR_FRAME_A] - lastFrameA) * percent; } + slot = skeleton->slots[self->slotIndex]; if (alpha < 1) { slot->r += (r - slot->r) * alpha; slot->g += (g - slot->g) * alpha; diff --git a/spine-csharp/src/Animation.cs b/spine-csharp/src/Animation.cs index 19d892ca5..cb24256fd 100644 --- a/spine-csharp/src/Animation.cs +++ b/spine-csharp/src/Animation.cs @@ -361,8 +361,6 @@ namespace Spine { float[] frames = this.frames; if (time < frames[0]) return; // Time is before first frame. - Slot slot = skeleton.slots[slotIndex]; - float r, g, b, a; if (time >= frames[frames.Length - 5]) { // Time is after last frame. @@ -387,6 +385,7 @@ namespace Spine { b = lastFrameB + (frames[frameIndex + FRAME_B] - lastFrameB) * percent; a = lastFrameA + (frames[frameIndex + FRAME_A] - lastFrameA) * percent; } + Slot slot = skeleton.slots[slotIndex]; if (alpha < 1) { slot.r += (r - slot.r) * alpha; slot.g += (g - slot.g) * alpha; diff --git a/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index 8bbb7deb8..f0cee7c41 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -419,8 +419,6 @@ public class Animation { float[] frames = this.frames; if (time < frames[0]) return; // Time is before first frame. - Color color = skeleton.slots.get(slotIndex).color; - float r, g, b, a; if (time >= frames[frames.length - 5]) { // Time is after last frame. @@ -445,6 +443,7 @@ public class Animation { b = prevFrameB + (frames[frameIndex + FRAME_B] - prevFrameB) * percent; a = prevFrameA + (frames[frameIndex + FRAME_A] - prevFrameA) * percent; } + Color color = skeleton.slots.get(slotIndex).color; if (alpha < 1) color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); else