diff --git a/spine-c/include/spine/AttachmentLoader.h b/spine-c/include/spine/AttachmentLoader.h index 88b4db088..c447de35e 100644 --- a/spine-c/include/spine/AttachmentLoader.h +++ b/spine-c/include/spine/AttachmentLoader.h @@ -27,6 +27,7 @@ #define SPINE_ATTACHMENTLOADER_H_ #include +#include #ifdef __cplusplus namespace spine { @@ -44,7 +45,7 @@ struct AttachmentLoader { void AttachmentLoader_dispose (AttachmentLoader* self); /* Returns 0 to not load an attachment. If 0 is returned and AttachmentLoader.error1 is set, an error occurred. */ -Attachment* AttachmentLoader_newAttachment (AttachmentLoader* self, AttachmentType type, const char* name); +Attachment* AttachmentLoader_newAttachment (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name); #ifdef __cplusplus } diff --git a/spine-c/include/spine/extension.h b/spine-c/include/spine/extension.h index 29a080f73..168a22621 100644 --- a/spine-c/include/spine/extension.h +++ b/spine-c/include/spine/extension.h @@ -150,7 +150,7 @@ void _AtlasPage_deinit (AtlasPage* self); void _AttachmentLoader_init (AttachmentLoader* self, // void (*dispose) (AttachmentLoader* self), // - Attachment* (*newAttachment) (AttachmentLoader* self, AttachmentType type, const char* name)); + Attachment* (*newAttachment) (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name)); void _AttachmentLoader_deinit (AttachmentLoader* self); void _AttachmentLoader_setError (AttachmentLoader* self, const char* error1, const char* error2); void _AttachmentLoader_setUnknownTypeError (AttachmentLoader* self, AttachmentType type); diff --git a/spine-c/src/spine/AtlasAttachmentLoader.c b/spine-c/src/spine/AtlasAttachmentLoader.c index 51c13e946..a02a0b8f4 100644 --- a/spine-c/src/spine/AtlasAttachmentLoader.c +++ b/spine-c/src/spine/AtlasAttachmentLoader.c @@ -34,7 +34,7 @@ void _AtlasAttachmentLoader_dispose (AttachmentLoader* self) { _AttachmentLoader_deinit(self); } -Attachment* _AtlasAttachmentLoader_newAttachment (AttachmentLoader* loader, AttachmentType type, const char* name) { +Attachment* _AtlasAttachmentLoader_newAttachment (AttachmentLoader* loader, Skin* skin, AttachmentType type, const char* name) { AtlasAttachmentLoader* self = SUB_CAST(AtlasAttachmentLoader, loader); switch (type) { case ATTACHMENT_REGION: { diff --git a/spine-c/src/spine/AttachmentLoader.c b/spine-c/src/spine/AttachmentLoader.c index f9bc4c94b..2a1bcf227 100644 --- a/spine-c/src/spine/AttachmentLoader.c +++ b/spine-c/src/spine/AttachmentLoader.c @@ -32,13 +32,13 @@ namespace spine { #endif typedef struct _AttachmentLoaderVtable { - Attachment* (*newAttachment) (AttachmentLoader* self, AttachmentType type, const char* name); + Attachment* (*newAttachment) (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name); void (*dispose) (AttachmentLoader* self); } _AttachmentLoaderVtable; void _AttachmentLoader_init (AttachmentLoader* self, // void (*dispose) (AttachmentLoader* self), // - Attachment* (*newAttachment) (AttachmentLoader* self, AttachmentType type, const char* name)) { + Attachment* (*newAttachment) (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name)) { CONST_CAST(_AttachmentLoaderVtable*, self->vtable) = NEW(_AttachmentLoaderVtable); VTABLE(AttachmentLoader, self) ->dispose = dispose; VTABLE(AttachmentLoader, self) ->newAttachment = newAttachment; @@ -54,12 +54,12 @@ void AttachmentLoader_dispose (AttachmentLoader* self) { VTABLE(AttachmentLoader, self) ->dispose(self); } -Attachment* AttachmentLoader_newAttachment (AttachmentLoader* self, AttachmentType type, const char* name) { +Attachment* AttachmentLoader_newAttachment (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name) { FREE(self->error1); FREE(self->error2); self->error1 = 0; self->error2 = 0; - return VTABLE(AttachmentLoader, self) ->newAttachment(self, type, name); + return VTABLE(AttachmentLoader, self) ->newAttachment(self, skin, type, name); } void _AttachmentLoader_setError (AttachmentLoader* self, const char* error1, const char* error2) { diff --git a/spine-c/src/spine/SkeletonJson.c b/spine-c/src/spine/SkeletonJson.c index 242b74d43..cf05b47f3 100644 --- a/spine-c/src/spine/SkeletonJson.c +++ b/spine-c/src/spine/SkeletonJson.c @@ -349,7 +349,7 @@ SkeletonData* SkeletonJson_readSkeletonData (SkeletonJson* self, const char* jso return 0; } - Attachment* attachment = AttachmentLoader_newAttachment(self->attachmentLoader, type, attachmentName); + Attachment* attachment = AttachmentLoader_newAttachment(self->attachmentLoader, skin, type, attachmentName); if (!attachment) { if (self->attachmentLoader->error1) { SkeletonData_dispose(skeletonData);