mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[c] Fixed DeformTimeline, see #1016.
This commit is contained in:
parent
bb97951cf9
commit
dc16e55647
@ -851,7 +851,7 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
|
|||||||
slot->attachmentVerticesCapacity = vertexCount;
|
slot->attachmentVerticesCapacity = vertexCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slot->attachmentVerticesCount = vertexCount;
|
if (slot->attachmentVerticesCount == 0) alpha = 1;
|
||||||
|
|
||||||
frameVertices = self->frameVertices;
|
frameVertices = self->frameVertices;
|
||||||
vertices = slot->attachmentVertices;
|
vertices = slot->attachmentVertices;
|
||||||
@ -860,15 +860,15 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
|
|||||||
spVertexAttachment* vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
|
spVertexAttachment* vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case SP_MIX_POSE_SETUP:
|
case SP_MIX_POSE_SETUP:
|
||||||
if (!vertexAttachment->bones) {
|
slot->attachmentVerticesCount = 0;
|
||||||
memcpy(vertices, vertexAttachment->vertices, vertexCount * sizeof(float));
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < vertexCount; i++) vertices[i] = 0;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case SP_MIX_POSE_CURRENT:
|
case SP_MIX_POSE_CURRENT:
|
||||||
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
|
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
|
||||||
if (alpha == 1) break;
|
if (alpha == 1) {
|
||||||
|
slot->attachmentVerticesCount = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
slot->attachmentVerticesCount = vertexCount;
|
||||||
if (!vertexAttachment->bones) {
|
if (!vertexAttachment->bones) {
|
||||||
float* setupVertices = vertexAttachment->vertices;
|
float* setupVertices = vertexAttachment->vertices;
|
||||||
for (i = 0; i < vertexCount; i++) {
|
for (i = 0; i < vertexCount; i++) {
|
||||||
@ -884,6 +884,7 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slot->attachmentVerticesCount = vertexCount;
|
||||||
if (time >= frames[framesCount - 1]) { /* Time is after last frame. */
|
if (time >= frames[framesCount - 1]) { /* Time is after last frame. */
|
||||||
const float* lastVertices = self->frameVertices[framesCount - 1];
|
const float* lastVertices = self->frameVertices[framesCount - 1];
|
||||||
if (alpha == 1) {
|
if (alpha == 1) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user