From 5a541597cc232cb8f39c91864a5cd02bda54bbed Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 12 Jan 2022 09:05:34 +0100 Subject: [PATCH] [c] Fix compilation errors due to new type hierarchy. --- spine-c/spine-c/src/spine/SkeletonBinary.c | 5 ++--- spine-c/spine-c/src/spine/SkeletonJson.c | 5 ++--- spine-c/spine-c/src/spine/VertexAttachment.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/spine-c/spine-c/src/spine/SkeletonBinary.c b/spine-c/spine-c/src/spine/SkeletonBinary.c index b574f02c7..b7d2b7b64 100644 --- a/spine-c/spine-c/src/spine/SkeletonBinary.c +++ b/spine-c/spine-c/src/spine/SkeletonBinary.c @@ -1418,9 +1418,8 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const _spSkeletonBinary_setError(self, "Parent mesh not found: ", linkedMesh->parent); return NULL; } - linkedMesh->mesh->super.timelineAttachment = linkedMesh->inheritDeform ? SUB_CAST(spVertexAttachment, parent) - : SUB_CAST(spVertexAttachment, - linkedMesh->mesh); + linkedMesh->mesh->super.timelineAttachment = linkedMesh->inheritDeform ? parent + : SUPER(SUPER(linkedMesh->mesh)); spMeshAttachment_setParentMesh(linkedMesh->mesh, SUB_CAST(spMeshAttachment, parent)); spMeshAttachment_updateRegion(linkedMesh->mesh); spAttachmentLoader_configureAttachment(self->attachmentLoader, SUPER(SUPER(linkedMesh->mesh))); diff --git a/spine-c/spine-c/src/spine/SkeletonJson.c b/spine-c/spine-c/src/spine/SkeletonJson.c index 1c28da76c..a0a94ec1b 100644 --- a/spine-c/spine-c/src/spine/SkeletonJson.c +++ b/spine-c/spine-c/src/spine/SkeletonJson.c @@ -1514,9 +1514,8 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char _spSkeletonJson_setError(self, 0, "Parent mesh not found: ", linkedMesh->parent); return NULL; } - linkedMesh->mesh->super.timelineAttachment = linkedMesh->inheritDeform ? SUB_CAST(spVertexAttachment, parent) - : SUB_CAST(spVertexAttachment, - linkedMesh->mesh); + linkedMesh->mesh->super.timelineAttachment = linkedMesh->inheritDeform ? parent + : SUPER(SUPER(linkedMesh->mesh)); spMeshAttachment_setParentMesh(linkedMesh->mesh, SUB_CAST(spMeshAttachment, parent)); spMeshAttachment_updateRegion(linkedMesh->mesh); spAttachmentLoader_configureAttachment(self->attachmentLoader, SUPER(SUPER(linkedMesh->mesh))); diff --git a/spine-c/spine-c/src/spine/VertexAttachment.c b/spine-c/spine-c/src/spine/VertexAttachment.c index bf4109e63..23ac0a4ad 100644 --- a/spine-c/spine-c/src/spine/VertexAttachment.c +++ b/spine-c/spine-c/src/spine/VertexAttachment.c @@ -35,7 +35,7 @@ static int nextID = 0; void _spVertexAttachment_init(spVertexAttachment *attachment) { attachment->id = nextID++; - attachment->timelineAttachment = attachment; + attachment->timelineAttachment = SUPER(attachment); } void _spVertexAttachment_deinit(spVertexAttachment *attachment) {