소스 검색

Updated spine-c struct definitions to allow for forward declarations.

NathanSweet 10 년 전
부모
커밋
fb214ee276

+ 14 - 10
spine-c/include/spine/Animation.h

@@ -41,7 +41,7 @@ extern "C" {
 typedef struct spTimeline spTimeline;
 struct spSkeleton;
 
-typedef struct {
+typedef struct spAnimation {
 	const char* const name;
 	float duration;
 
@@ -114,7 +114,7 @@ typedef spTimeline Timeline;
 
 /**/
 
-typedef struct {
+typedef struct spCurveTimeline {
 	spTimeline super;
 	float* curves; /* type, x, y, ... */
 } spCurveTimeline;
@@ -143,7 +143,11 @@ typedef struct spBaseTimeline {
 	int const framesCount;
 	float* const frames; /* time, angle, ... for rotate. time, x, y, ... for translate and scale. */
 	int boneIndex;
-} spRotateTimeline;
+} spBaseTimeline;
+
+/**/
+
+typedef struct spBaseTimeline spRotateTimeline;
 
 spRotateTimeline* spRotateTimeline_create (int framesCount);
 
@@ -185,7 +189,7 @@ typedef spScaleTimeline ScaleTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spColorTimeline {
 	spCurveTimeline super;
 	int const framesCount;
 	float* const frames; /* time, r, g, b, a, ... */
@@ -204,7 +208,7 @@ typedef spColorTimeline ColorTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spAttachmentTimeline {
 	spTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -225,7 +229,7 @@ typedef spAttachmentTimeline AttachmentTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spEventTimeline {
 	spTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -244,7 +248,7 @@ typedef spEventTimeline EventTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spDrawOrderTimeline {
 	spTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -264,7 +268,7 @@ typedef spDrawOrderTimeline DrawOrderTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spFFDTimeline {
 	spCurveTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -286,7 +290,7 @@ typedef spFFDTimeline FFDTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spIkConstraintTimeline {
 	spCurveTimeline super;
 	int const framesCount;
 	float* const frames; /* time, mix, bendDirection, ... */
@@ -306,7 +310,7 @@ typedef spIkConstraintTimeline IkConstraintTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spFlipTimeline {
 	spTimeline super;
 	int const x;
 	int const framesCount;

+ 1 - 1
spine-c/include/spine/AnimationStateData.h

@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spAnimationStateData {
 	spSkeletonData* const skeletonData;
 	float defaultMix;
 	const void* const entries;

+ 1 - 1
spine-c/include/spine/AtlasAttachmentLoader.h

@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spAtlasAttachmentLoader {
 	spAttachmentLoader super;
 	spAtlas* atlas;
 } spAtlasAttachmentLoader;

+ 2 - 5
spine-c/include/spine/Attachment.h

@@ -35,19 +35,16 @@
 extern "C" {
 #endif
 
-struct spSlot;
-
 typedef enum {
 	SP_ATTACHMENT_REGION, SP_ATTACHMENT_BOUNDING_BOX, SP_ATTACHMENT_MESH, SP_ATTACHMENT_SKINNED_MESH
 } spAttachmentType;
 
-typedef struct spAttachment spAttachment;
-struct spAttachment {
+typedef struct spAttachment {
 	const char* const name;
 	const spAttachmentType type;
 
 	const void* const vtable;
-};
+} spAttachment;
 
 void spAttachment_dispose (spAttachment* self);
 

+ 2 - 3
spine-c/include/spine/AttachmentLoader.h

@@ -38,8 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct spAttachmentLoader spAttachmentLoader;
-struct spAttachmentLoader {
+typedef struct spAttachmentLoader {
 	const char* error1;
 	const char* error2;
 
@@ -51,7 +50,7 @@ struct spAttachmentLoader {
 					vtable(0) {
 	}
 #endif
-};
+} spAttachmentLoader;
 
 void spAttachmentLoader_dispose (spAttachmentLoader* self);
 

+ 2 - 3
spine-c/include/spine/BoundingBoxAttachment.h

@@ -39,12 +39,11 @@
 extern "C" {
 #endif
 
-typedef struct spBoundingBoxAttachment spBoundingBoxAttachment;
-struct spBoundingBoxAttachment {
+typedef struct spBoundingBoxAttachment {
 	spAttachment super;
 	int verticesCount;
 	float* vertices;
-};
+} spBoundingBoxAttachment;
 
 spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);
 void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spBone* bone, float* vertices);

+ 2 - 3
spine-c/include/spine/Event.h

@@ -37,13 +37,12 @@
 extern "C" {
 #endif
 
-typedef struct spEvent spEvent;
-struct spEvent {
+typedef struct spEvent {
 	spEventData* const data;
 	int intValue;
 	float floatValue;
 	const char* stringValue;
-};
+} spEvent;
 
 spEvent* spEvent_create (spEventData* data);
 void spEvent_dispose (spEvent* self);

+ 2 - 3
spine-c/include/spine/EventData.h

@@ -35,13 +35,12 @@
 extern "C" {
 #endif
 
-typedef struct spEventData spEventData;
-struct spEventData {
+typedef struct spEventData {
 	const char* const name;
 	int intValue;
 	float floatValue;
 	const char* stringValue;
-};
+} spEventData;
 
 spEventData* spEventData_create (const char* name);
 void spEventData_dispose (spEventData* self);

+ 2 - 3
spine-c/include/spine/IkConstraint.h

@@ -40,8 +40,7 @@ extern "C" {
 
 struct spSkeleton;
 
-typedef struct spIkConstraint spIkConstraint;
-struct spIkConstraint {
+typedef struct spIkConstraint {
 	spIkConstraintData* const data;
 	
 	int bonesCount;
@@ -50,7 +49,7 @@ struct spIkConstraint {
 	spBone* target;
 	int bendDirection;
 	float mix;
-};
+} spIkConstraint;
 
 spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton);
 void spIkConstraint_dispose (spIkConstraint* self);

+ 2 - 3
spine-c/include/spine/IkConstraintData.h

@@ -37,8 +37,7 @@
 extern "C" {
 #endif
 
-typedef struct spIkConstraintData spIkConstraintData;
-struct spIkConstraintData {
+typedef struct spIkConstraintData {
 	const char* const name;
 	
 	int bonesCount;
@@ -47,7 +46,7 @@ struct spIkConstraintData {
 	spBoneData* target;
 	int bendDirection;
 	float mix;
-};
+} spIkConstraintData;
 
 spIkConstraintData* spIkConstraintData_create (const char* name);
 void spIkConstraintData_dispose (spIkConstraintData* self);

+ 2 - 3
spine-c/include/spine/MeshAttachment.h

@@ -39,8 +39,7 @@
 extern "C" {
 #endif
 
-typedef struct spMeshAttachment spMeshAttachment;
-struct spMeshAttachment {
+typedef struct spMeshAttachment {
 	spAttachment super;
 	const char* path;
 
@@ -67,7 +66,7 @@ struct spMeshAttachment {
 	int edgesCount;
 	int* edges;
 	float width, height;
-};
+} spMeshAttachment;
 
 spMeshAttachment* spMeshAttachment_create (const char* name);
 void spMeshAttachment_updateUVs (spMeshAttachment* self);

+ 2 - 3
spine-c/include/spine/RegionAttachment.h

@@ -43,8 +43,7 @@ typedef enum {
 	SP_VERTEX_X1 = 0, SP_VERTEX_Y1, SP_VERTEX_X2, SP_VERTEX_Y2, SP_VERTEX_X3, SP_VERTEX_Y3, SP_VERTEX_X4, SP_VERTEX_Y4
 } spVertexIndex;
 
-typedef struct spRegionAttachment spRegionAttachment;
-struct spRegionAttachment {
+typedef struct spRegionAttachment {
 	spAttachment super;
 	const char* path;
 	float x, y, scaleX, scaleY, rotation, width, height;
@@ -57,7 +56,7 @@ struct spRegionAttachment {
 
 	float offset[8];
 	float uvs[8];
-};
+} spRegionAttachment;
 
 spRegionAttachment* spRegionAttachment_create (const char* name);
 void spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate);

+ 2 - 3
spine-c/include/spine/Skeleton.h

@@ -40,8 +40,7 @@
 extern "C" {
 #endif
 
-typedef struct spSkeleton spSkeleton;
-struct spSkeleton {
+typedef struct spSkeleton {
 	spSkeletonData* const data;
 
 	int bonesCount;
@@ -60,7 +59,7 @@ struct spSkeleton {
 	float time;
 	int/*bool*/flipX, flipY;
 	float x, y;
-};
+} spSkeleton;
 
 spSkeleton* spSkeleton_create (spSkeletonData* data);
 void spSkeleton_dispose (spSkeleton* self);

+ 2 - 2
spine-c/include/spine/SkeletonBounds.h

@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spPolygon {
 	float* const vertices;
 	int count;
 	int capacity;
@@ -60,7 +60,7 @@ typedef spPolygon Polygon;
 
 /**/
 
-typedef struct {
+typedef struct spSkeletonBounds {
 	int count;
 	spBoundingBoxAttachment** boundingBoxes;
 	spPolygon** polygons;

+ 1 - 1
spine-c/include/spine/SkeletonData.h

@@ -42,7 +42,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spSkeletonData {
 	const char* version;
 	const char* hash;
 	float width, height;

+ 1 - 1
spine-c/include/spine/SkeletonJson.h

@@ -41,7 +41,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spSkeletonJson {
 	float scale;
 	spAttachmentLoader* attachmentLoader;
 	const char* const error;

+ 1 - 1
spine-c/include/spine/Skin.h

@@ -39,7 +39,7 @@ extern "C" {
 
 struct spSkeleton;
 
-typedef struct {
+typedef struct spSkin {
 	const char* const name;
 } spSkin;
 

+ 2 - 3
spine-c/include/spine/SkinnedMeshAttachment.h

@@ -38,8 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct spSkinnedMeshAttachment spSkinnedMeshAttachment;
-struct spSkinnedMeshAttachment {
+typedef struct spSkinnedMeshAttachment {
 	spAttachment super;
 	const char* path;
 
@@ -70,7 +69,7 @@ struct spSkinnedMeshAttachment {
 	int edgesCount;
 	int* edges;
 	float width, height;
-};
+} spSkinnedMeshAttachment;
 
 spSkinnedMeshAttachment* spSkinnedMeshAttachment_create (const char* name);
 void spSkinnedMeshAttachment_updateUVs (spSkinnedMeshAttachment* self);

+ 1 - 1
spine-c/include/spine/SlotData.h

@@ -37,7 +37,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spSlotData {
 	const char* const name;
 	const spBoneData* const boneData;
 	const char* attachmentName;

+ 1 - 1
spine-c/include/spine/extension.h

@@ -124,7 +124,7 @@ char* _readFile (const char* path, int* length);
 
 /**/
 
-typedef struct {
+typedef struct _spAnimationState {
 	spAnimationState super;
 	spEvent** events;