From 9f198b49986758d03c21e72b13ba118569cad27c Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sat, 6 Apr 2013 19:00:26 +0200 Subject: [PATCH] Fixed cocos2d for ARC. Issue #24 --- .../src/spine/spine-cocos2d-iphone.h | 23 +------------------ .../src/spine/spine-cocos2d-iphone.m | 22 ++++++++++++++++++ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.h b/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.h index 7b247416e..345c49e03 100644 --- a/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.h +++ b/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.h @@ -29,33 +29,12 @@ #include #include "cocos2d.h" -@class CCSkeleton; - #ifdef __cplusplus namespace spine { extern "C" { #endif -typedef struct { - AtlasPage super; - CCTexture2D* texture; - CCTextureAtlas* textureAtlas; -} Cocos2dAtlasPage; - -/**/ - -typedef struct { - Skeleton super; - CCSkeleton* node; -} Cocos2dSkeleton; - -/**/ - -typedef struct { - RegionAttachment super; - ccV3F_C4B_T2F_Quad quad; - CCTextureAtlas* textureAtlas; -} Cocos2dRegionAttachment; +ccV3F_C4B_T2F_Quad* RegionAttachment_getQuad (RegionAttachment* self); #ifdef __cplusplus } diff --git a/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m b/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m index 4d4e73b97..912fc0b58 100644 --- a/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m +++ b/spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m @@ -30,6 +30,12 @@ namespace spine { #endif +typedef struct { + AtlasPage super; + CCTexture2D* texture; + CCTextureAtlas* textureAtlas; +} Cocos2dAtlasPage; + void _Cocos2dAtlasPage_dispose (AtlasPage* page) { Cocos2dAtlasPage* self = SUB_CAST(Cocos2dAtlasPage, page); _AtlasPage_deinit(SUPER(self)); @@ -55,6 +61,11 @@ AtlasPage* AtlasPage_create (const char* name, const char* path) { /**/ +typedef struct { + Skeleton super; + CCSkeleton* node; +} Cocos2dSkeleton; + void _Cocos2dSkeleton_dispose (Skeleton* self) { _Skeleton_deinit(self); FREE(self); @@ -72,6 +83,12 @@ Skeleton* _Cocos2dSkeleton_create (SkeletonData* data, CCSkeleton* node) { /**/ +typedef struct { + RegionAttachment super; + ccV3F_C4B_T2F_Quad quad; + CCTextureAtlas* textureAtlas; +} Cocos2dRegionAttachment; + void _Cocos2dRegionAttachment_dispose (Attachment* self) { _RegionAttachment_deinit(SUB_CAST(RegionAttachment, self) ); FREE(self); @@ -163,6 +180,11 @@ RegionAttachment* RegionAttachment_create (const char* name, AtlasRegion* region return SUPER(self); } +ccV3F_C4B_T2F_Quad* RegionAttachment_getQuad (RegionAttachment* attachment) { + Cocos2dRegionAttachment* self = SUB_CAST(Cocos2dRegionAttachment, attachment); + return &self->quad; +} + /**/ char* _Util_readFile (const char* path, int* length) {