|
@@ -54,8 +54,8 @@
|
|
|
#define SPINE_EXTENSION_H_
|
|
|
|
|
|
/* All allocation uses these. */
|
|
|
-#define MALLOC(TYPE,COUNT) ((TYPE*)malloc(sizeof(TYPE) * COUNT))
|
|
|
-#define CALLOC(TYPE,COUNT) ((TYPE*)calloc(1, sizeof(TYPE) * COUNT))
|
|
|
+#define MALLOC(TYPE,COUNT) ((TYPE*)_malloc(sizeof(TYPE) * COUNT))
|
|
|
+#define CALLOC(TYPE,COUNT) ((TYPE*)_calloc(1, sizeof(TYPE) * COUNT))
|
|
|
#define NEW(TYPE) CALLOC(TYPE,1)
|
|
|
|
|
|
/* Gets the direct super class. Type safe. */
|
|
@@ -74,7 +74,7 @@
|
|
|
#define VTABLE(TYPE,VALUE) ((_##TYPE##Vtable*)((TYPE*)VALUE)->vtable)
|
|
|
|
|
|
/* Frees memory. Can be used on const. */
|
|
|
-#define FREE(VALUE) free((void*)VALUE)
|
|
|
+#define FREE(VALUE) _free((void*)VALUE)
|
|
|
|
|
|
/* Allocates a new char[], assigns it to TO, and copies FROM to it. Can be used on const. */
|
|
|
#define MALLOC_STR(TO,FROM) strcpy(CONST_CAST(char*, TO) = (char*)malloc(strlen(FROM) + 1), FROM)
|
|
@@ -106,50 +106,59 @@ char* _Util_readFile (const char* path, int* length);
|
|
|
* Internal API available for extension:
|
|
|
*/
|
|
|
|
|
|
+void* _malloc (size_t size);
|
|
|
+void* _calloc (size_t num, size_t size);
|
|
|
+void _free (void* ptr);
|
|
|
+
|
|
|
+void _setMalloc (void* (*_malloc) (size_t size));
|
|
|
+void _setFree (void (*_free) (void* ptr));
|
|
|
+
|
|
|
char* _readFile (const char* path, int* length);
|
|
|
|
|
|
-void _Skeleton_init (Skeleton* self, SkeletonData* data, /**/
|
|
|
+/**/
|
|
|
+
|
|
|
+void _Skeleton_init (Skeleton* self, SkeletonData* data, //
|
|
|
void (*dispose) (Skeleton* skeleton));
|
|
|
void _Skeleton_deinit (Skeleton* self);
|
|
|
|
|
|
/**/
|
|
|
|
|
|
-void _Attachment_init (Attachment* self, const char* name, AttachmentType type, /**/
|
|
|
- void (*dispose) (Attachment* self), /**/
|
|
|
+void _Attachment_init (Attachment* self, const char* name, AttachmentType type, //
|
|
|
+ void (*dispose) (Attachment* self), //
|
|
|
void (*draw) (Attachment* self, struct Slot* slot));
|
|
|
void _Attachment_deinit (Attachment* self);
|
|
|
|
|
|
/**/
|
|
|
|
|
|
-void _RegionAttachment_init (RegionAttachment* self, const char* name, /**/
|
|
|
- void (*dispose) (Attachment* self), /**/
|
|
|
+void _RegionAttachment_init (RegionAttachment* self, const char* name, //
|
|
|
+ void (*dispose) (Attachment* self), //
|
|
|
void (*draw) (Attachment* self, struct Slot* slot));
|
|
|
void _RegionAttachment_deinit (RegionAttachment* self);
|
|
|
|
|
|
/**/
|
|
|
|
|
|
-void _Timeline_init (Timeline* self, /**/
|
|
|
- void (*dispose) (Timeline* self), /**/
|
|
|
+void _Timeline_init (Timeline* self, //
|
|
|
+ void (*dispose) (Timeline* self), //
|
|
|
void (*apply) (const Timeline* self, Skeleton* skeleton, float time, float alpha));
|
|
|
void _Timeline_deinit (Timeline* self);
|
|
|
|
|
|
/**/
|
|
|
|
|
|
-void _CurveTimeline_init (CurveTimeline* self, int frameCount, /**/
|
|
|
- void (*dispose) (Timeline* self), /**/
|
|
|
+void _CurveTimeline_init (CurveTimeline* self, int frameCount, //
|
|
|
+ void (*dispose) (Timeline* self), //
|
|
|
void (*apply) (const Timeline* self, Skeleton* skeleton, float time, float alpha));
|
|
|
void _CurveTimeline_deinit (CurveTimeline* self);
|
|
|
|
|
|
/**/
|
|
|
|
|
|
-void _AtlasPage_init (AtlasPage* self, const char* name, /**/
|
|
|
+void _AtlasPage_init (AtlasPage* self, const char* name, //
|
|
|
void (*dispose) (AtlasPage* self));
|
|
|
void _AtlasPage_deinit (AtlasPage* self);
|
|
|
|
|
|
/**/
|
|
|
|
|
|
-void _AttachmentLoader_init (AttachmentLoader* self, /**/
|
|
|
- void (*dispose) (AttachmentLoader* self), /**/
|
|
|
+void _AttachmentLoader_init (AttachmentLoader* self, //
|
|
|
+ void (*dispose) (AttachmentLoader* self), //
|
|
|
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);
|