Fixed FfdTimeline for spine-c.

This commit is contained in:
NathanSweet 2014-10-01 01:31:52 +02:00
parent ab6e07765c
commit 53437a6159
3 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ public class FfdTimeline extends CurveTimeline {
var vertexCount:int = frameVertices[0].length;
var vertices:Vector.<Number> = slot.attachmentVertices;
if (vertices.length != vertexCount) alpha = 1;
if (vertices.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
vertices.length = vertexCount;
var i:int;

View File

@ -664,15 +664,15 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
return; /* Time is before first frame. */
}
if (slot->attachmentVerticesCount == 0) alpha = 1;
if (slot->attachmentVerticesCount != self->frameVerticesCount) alpha = 1; // Don't mix from uninitialized slot vertices.
if (slot->attachmentVerticesCount < self->frameVerticesCount) {
if (slot->attachmentVerticesCapacity < self->frameVerticesCount) {
FREE(slot->attachmentVertices);
slot->attachmentVertices = MALLOC(float, self->frameVerticesCount);
slot->attachmentVerticesCapacity = self->frameVerticesCount;
}
slot->attachmentVerticesCount = self->frameVerticesCount;
}
slot->attachmentVerticesCount = self->frameVerticesCount;
if (time >= self->frames[self->framesCount - 1]) {
/* Time is after last frame. */

View File

@ -580,7 +580,7 @@ namespace Spine {
int vertexCount = frameVertices[0].Length;
float[] vertices = slot.attachmentVertices;
if (vertices.Length != vertexCount) alpha = 1;
if (vertices.Length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
if (vertices.Length < vertexCount) {
vertices = new float[vertexCount];
slot.attachmentVertices = vertices;