Parcourir la source

Fix mixing from uninitialized slot vertices.

NathanSweet il y a 10 ans
Parent
commit
ee849c62eb
3 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. 2 2
      spine-c/src/spine/Animation.c
  2. 2 2
      spine-csharp/src/Animation.cs
  3. 2 1
      spine-lua/Animation.lua

+ 2 - 2
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]) {

+ 2 - 2
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.

+ 2 - 1
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