Fix mixing from uninitialized slot vertices.

This commit is contained in:
NathanSweet 2015-01-30 15:40:13 +01:00
parent 1a480cd707
commit ee849c62eb
3 changed files with 6 additions and 5 deletions

View File

@ -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]) {

View File

@ -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.

View File

@ -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