mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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 <spine/spine.h>
|
||||||
#include "cocos2d.h"
|
#include "cocos2d.h"
|
||||||
|
|
||||||
@class CCSkeleton;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
namespace spine {
|
namespace spine {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
ccV3F_C4B_T2F_Quad* RegionAttachment_getQuad (RegionAttachment* self);
|
||||||
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;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,12 @@
|
|||||||
namespace spine {
|
namespace spine {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
AtlasPage super;
|
||||||
|
CCTexture2D* texture;
|
||||||
|
CCTextureAtlas* textureAtlas;
|
||||||
|
} Cocos2dAtlasPage;
|
||||||
|
|
||||||
void _Cocos2dAtlasPage_dispose (AtlasPage* page) {
|
void _Cocos2dAtlasPage_dispose (AtlasPage* page) {
|
||||||
Cocos2dAtlasPage* self = SUB_CAST(Cocos2dAtlasPage, page);
|
Cocos2dAtlasPage* self = SUB_CAST(Cocos2dAtlasPage, page);
|
||||||
_AtlasPage_deinit(SUPER(self));
|
_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) {
|
void _Cocos2dSkeleton_dispose (Skeleton* self) {
|
||||||
_Skeleton_deinit(self);
|
_Skeleton_deinit(self);
|
||||||
FREE(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) {
|
void _Cocos2dRegionAttachment_dispose (Attachment* self) {
|
||||||
_RegionAttachment_deinit(SUB_CAST(RegionAttachment, self) );
|
_RegionAttachment_deinit(SUB_CAST(RegionAttachment, self) );
|
||||||
FREE(self);
|
FREE(self);
|
||||||
@ -163,6 +180,11 @@ RegionAttachment* RegionAttachment_create (const char* name, AtlasRegion* region
|
|||||||
return SUPER(self);
|
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) {
|
char* _Util_readFile (const char* path, int* length) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user