mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[cpp] Fix incorrect cast to VertexAttachment in SkeletonBinary
This commit is contained in:
parent
73b9b2af04
commit
b65fef5b7a
@ -1249,13 +1249,13 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S
|
|||||||
setError("Attachment not found: ", attachmentName);
|
setError("Attachment not found: ", attachmentName);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
VertexAttachment *attachment = static_cast<VertexAttachment *>(baseAttachment);
|
|
||||||
unsigned int timelineType = readByte(input);
|
unsigned int timelineType = readByte(input);
|
||||||
int frameCount = readVarint(input, true);
|
int frameCount = readVarint(input, true);
|
||||||
int frameLast = frameCount - 1;
|
int frameLast = frameCount - 1;
|
||||||
|
|
||||||
switch (timelineType) {
|
switch (timelineType) {
|
||||||
case ATTACHMENT_DEFORM: {
|
case ATTACHMENT_DEFORM: {
|
||||||
|
VertexAttachment *attachment = static_cast<VertexAttachment *>(baseAttachment);
|
||||||
bool weighted = attachment->_bones.size() > 0;
|
bool weighted = attachment->_bones.size() > 0;
|
||||||
Vector<float> &vertices = attachment->_vertices;
|
Vector<float> &vertices = attachment->_vertices;
|
||||||
int deformLength = weighted ? (int) vertices.size() / 3 * 2 : (int) vertices.size();
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case ATTACHMENT_SEQUENCE: {
|
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++) {
|
for (int frame = 0; frame < frameCount; frame++) {
|
||||||
float time = readFloat(input);
|
float time = readFloat(input);
|
||||||
int modeAndIndex = readInt(input);
|
int modeAndIndex = readInt(input);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user