diff --git a/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp b/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp index f6e19a81f..03cf06bb9 100644 --- a/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp @@ -100,23 +100,23 @@ void DeformTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto return; } deformArray.setSize(vertexCount, 0); - Vector &deformInner = deformArray; + Vector &deform = deformArray; if (attachment->getBones().size() == 0) { // Unweighted vertex positions. Vector &setupVertices = attachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) - deformInner[i] += (setupVertices[i] - deformInner[i]) * alpha; + deform[i] += (setupVertices[i] - deform[i]) * alpha; } else { // Weighted deform offsets. alpha = 1 - alpha; for (size_t i = 0; i < vertexCount; i++) - deformInner[i] *= alpha; + deform[i] *= alpha; } } case MixBlend_Replace: - case MixBlend_Add: - return; + case MixBlend_Add: {} } + return; } deformArray.setSize(vertexCount, 0); diff --git a/spine-cpp/spine-cpp/src/spine/Slot.cpp b/spine-cpp/spine-cpp/src/spine/Slot.cpp index f8f26ce8a..220707bed 100644 --- a/spine-cpp/spine-cpp/src/spine/Slot.cpp +++ b/spine-cpp/spine-cpp/src/spine/Slot.cpp @@ -99,7 +99,9 @@ void Slot::setAttachment(Attachment *inValue) { return; } - if (inValue && _attachment) { + if (!inValue || !_attachment) { + _deform.clear(); + } else { if (!(inValue->getRTTI().instanceOf(VertexAttachment::rtti)) || !(_attachment->getRTTI().instanceOf(VertexAttachment::rtti)) || (static_cast(inValue)->getDeformAttachment() !=