From b65fef5b7a2454bf71fcdf557c531eb29373e070 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Thu, 24 Nov 2022 06:21:19 +0100 Subject: [PATCH] [cpp] Fix incorrect cast to VertexAttachment in SkeletonBinary --- spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp index dca81584f..46f5f8751 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp @@ -1249,13 +1249,13 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S setError("Attachment not found: ", attachmentName); return NULL; } - VertexAttachment *attachment = static_cast(baseAttachment); unsigned int timelineType = readByte(input); int frameCount = readVarint(input, true); int frameLast = frameCount - 1; switch (timelineType) { case ATTACHMENT_DEFORM: { + VertexAttachment *attachment = static_cast(baseAttachment); bool weighted = attachment->_bones.size() > 0; Vector &vertices = attachment->_vertices; int deformLength = weighted ? (int) vertices.size() / 3 * 2 : (int) vertices.size(); @@ -1311,7 +1311,7 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S break; } case ATTACHMENT_SEQUENCE: { - SequenceTimeline *timeline = new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, attachment); + SequenceTimeline *timeline = new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, baseAttachment); for (int frame = 0; frame < frameCount; frame++) { float time = readFloat(input); int modeAndIndex = readInt(input);