From ee849c62ebd79d26ae49cec845e6d725a3f1cd11 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Fri, 30 Jan 2015 15:40:13 +0100 Subject: [PATCH] Fix mixing from uninitialized slot vertices. --- spine-c/src/spine/Animation.c | 4 ++-- spine-csharp/src/Animation.cs | 4 ++-- spine-lua/Animation.lua | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spine-c/src/spine/Animation.c b/spine-c/src/spine/Animation.c index 01138f02f..51b01ebd9 100644 --- a/spine-c/src/spine/Animation.c +++ b/spine-c/src/spine/Animation.c @@ -667,8 +667,8 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo slot->attachmentVertices = MALLOC(float, self->frameVerticesCount); slot->attachmentVerticesCapacity = self->frameVerticesCount; } - } else if (slot->attachmentVerticesCount > self->frameVerticesCount) - alpha = 1; /* Don't mix from uninitialized slot vertices. */ + } + if (slot->attachmentVerticesCount != self->frameVerticesCount) alpha = 1; /* Don't mix from uninitialized slot vertices. */ slot->attachmentVerticesCount = self->frameVerticesCount; if (time >= self->frames[self->framesCount - 1]) { diff --git a/spine-csharp/src/Animation.cs b/spine-csharp/src/Animation.cs index 0cb0a4eaf..49497395c 100644 --- a/spine-csharp/src/Animation.cs +++ b/spine-csharp/src/Animation.cs @@ -580,8 +580,8 @@ namespace Spine { if (vertices.Length < vertexCount) { vertices = new float[vertexCount]; slot.attachmentVertices = vertices; - } else if (vertices.Length > vertexCount) - alpha = 1; // Don't mix from uninitialized slot vertices. + } + if (vertices.Length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices. slot.attachmentVerticesCount = vertexCount; if (time >= frames[frames.Length - 1]) { // Time is after last frame. diff --git a/spine-lua/Animation.lua b/spine-lua/Animation.lua index 3c6b2ed23..66edaeb63 100644 --- a/spine-lua/Animation.lua +++ b/spine-lua/Animation.lua @@ -614,7 +614,8 @@ function Animation.FfdTimeline.new () if #vertices < vertexCount then vertices = {} slot.attachmentVertices = vertices - elseif #vertices < vertexCount then + end + if #vertices ~= vertexCount then alpha = 1 -- Don't mix from uninitialized slot vertices. end slot.attachmentVerticesCount = vertexCount