mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-21 01:06:43 +08:00
Fixed cocos2d for ARC. Issue #24
This commit is contained in:
parent
a165849d6e
commit
9f198b4998
@ -29,33 +29,12 @@
|
||||
#include <spine/spine.h>
|
||||
#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
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user