Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[c][sfml][cocos2d-x][cocos2d-objc] Updated to 3.3.07 #629

Merged
merged 1 commit into from
Jul 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ spine-sfml/Debug/*
spine-sfml/SFML
spine-sfml/dependencies

spine-libgdx/spine-libgdx/bin/*
spine-libgdx/spine-libgdx-tests/bin/*
spine-libgdx/spine-skeletonviewer/bin/*
spine-libgdx/spine-libgdx/bin
spine-libgdx/spine-libgdx-tests/bin
spine-libgdx/spine-skeletonviewer/bin

spine-cocos2dx/dependencies
spine-cocos2dx/example/cocos2dx.zip
Expand All @@ -35,8 +35,8 @@ spine-cocos2dx/example/cocos2d
spine-cocos2dx/example/proj.win32/spine-cocos2d-x.VC.opendb
xcuserdata/

spine-cocos2d-iphone/cocos2d/*
spine-cocos2d-iphone/spine-cocos2d-iphone-ios.xcodeproj/project.xcworkspace/xcshareddata/
spine-cocos2d-objc/cocos2d/*
spine-cocos2d-objc/spine-cocos2d-iphone-objc.xcodeproj/project.xcworkspace/xcshareddata/

spine-csharp/bin
spine-csharp/obj
Expand Down
3 changes: 1 addition & 2 deletions spine-c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Spine Runtimes are developed with the intent to be used with data exported f

## Spine version

spine-c works with data exported from Spine version 3.2.01.
spine-c works with data exported from Spine version 3.3.07.

spine-c supports all Spine features.

Expand Down Expand Up @@ -48,4 +48,3 @@ spine-c uses an OOP style of programming where each "class" is made up of a stru
- [spine-cocos2d-iphone](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone)
- [spine-cocos2dx](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2dx)
- [spine-sfml](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml)
- [spine-torque2d](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-torque2d)
129 changes: 116 additions & 13 deletions spine-c/include/spine/Animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ void spAnimation_dispose (spAnimation* self);

/** Poses the skeleton at the specified time for this animation.
* @param lastTime The last time the animation was applied.
* @param events Any triggered events are added. */
* @param events Any triggered events are added. May be null.*/
void spAnimation_apply (const spAnimation* self, struct spSkeleton* skeleton, float lastTime, float time, int loop,
spEvent** events, int* eventsCount);

/** Poses the skeleton at the specified time for this animation mixed with the current pose.
* @param lastTime The last time the animation was applied.
* @param events Any triggered events are added.
* @param events Any triggered events are added. May be null.
* @param alpha The amount of this animation that affects the current pose. */
void spAnimation_mix (const spAnimation* self, struct spSkeleton* skeleton, float lastTime, float time, int loop,
spEvent** events, int* eventsCount, float alpha);
Expand All @@ -94,9 +94,12 @@ typedef enum {
SP_TIMELINE_ATTACHMENT,
SP_TIMELINE_EVENT,
SP_TIMELINE_DRAWORDER,
SP_TIMELINE_FFD,
SP_TIMELINE_DEFORM,
SP_TIMELINE_IKCONSTRAINT,
SP_TIMELINE_TRANSFORMCONSTRAINT
SP_TIMELINE_TRANSFORMCONSTRAINT,
SP_TIMELINE_PATHCONSTRAINTPOSITION,
SP_TIMELINE_PATHCONSTRAINTSPACING,
SP_TIMELINE_PATHCONSTRAINTMIX
} spTimelineType;

struct spTimeline {
Expand Down Expand Up @@ -179,6 +182,8 @@ typedef struct spBaseTimeline {

/**/

static const int ROTATE_ENTRIES = 2;

typedef struct spBaseTimeline spRotateTimeline;

spRotateTimeline* spRotateTimeline_create (int framesCount);
Expand All @@ -193,6 +198,8 @@ typedef spRotateTimeline RotateTimeline;

/**/

static const int TRANSLATE_ENTRIES = 3;

typedef struct spBaseTimeline spTranslateTimeline;

spTranslateTimeline* spTranslateTimeline_create (int framesCount);
Expand Down Expand Up @@ -235,6 +242,8 @@ typedef spShearTimeline ShearTimeline;

/**/

static const int COLOR_ENTRIES = 5;

typedef struct spColorTimeline {
spCurveTimeline super;
int const framesCount;
Expand Down Expand Up @@ -352,7 +361,7 @@ typedef spDrawOrderTimeline DrawOrderTimeline;

/**/

typedef struct spFFDTimeline {
typedef struct spDeformTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, ... */
Expand All @@ -362,7 +371,7 @@ typedef struct spFFDTimeline {
spAttachment* attachment;

#ifdef __cplusplus
spFFDTimeline() :
spDeformTimeline() :
super(),
framesCount(0),
frames(0),
Expand All @@ -371,20 +380,22 @@ typedef struct spFFDTimeline {
slotIndex(0) {
}
#endif
} spFFDTimeline;
} spDeformTimeline;

spFFDTimeline* spFFDTimeline_create (int framesCount, int frameVerticesCount);
spDeformTimeline* spDeformTimeline_create (int framesCount, int frameVerticesCount);

void spFFDTimeline_setFrame (spFFDTimeline* self, int frameIndex, float time, float* vertices);
void spDeformTimeline_setFrame (spDeformTimeline* self, int frameIndex, float time, float* vertices);

#ifdef SPINE_SHORT_NAMES
typedef spFFDTimeline FFDTimeline;
#define FFDTimeline_create(...) spFFDTimeline_create(__VA_ARGS__)
#define FFDTimeline_setFrame(...) spFFDTimeline_setFrame(__VA_ARGS__)
typedef spDeformTimeline DeformTimeline;
#define DeformTimeline_create(...) spDeformTimeline_create(__VA_ARGS__)
#define DeformTimeline_setFrame(...) spDeformTimeline_setFrame(__VA_ARGS__)
#endif

/**/

static const int IKCONSTRAINT_ENTRIES = 3;

typedef struct spIkConstraintTimeline {
spCurveTimeline super;
int const framesCount;
Expand Down Expand Up @@ -413,10 +424,12 @@ typedef spIkConstraintTimeline IkConstraintTimeline;

/**/

static const int TRANSFORMCONSTRAINT_ENTRIES = 5;

typedef struct spTransformConstraintTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, mix, bendDirection, ... */
float* const frames; /* time, rotate mix, translate mix, scale mix, shear mix, ... */
int transformConstraintIndex;

#ifdef __cplusplus
Expand All @@ -441,6 +454,96 @@ typedef spTransformConstraintTimeline TransformConstraintTimeline;

/**/

static const int PATHCONSTRAINTPOSITION_ENTRIES = 2;

typedef struct spPathConstraintPositionTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, rotate mix, translate mix, scale mix, shear mix, ... */
int pathConstraintIndex;

#ifdef __cplusplus
spPathConstraintPositionTimeline() :
super(),
framesCount(0),
frames(0),
pathConstraintIndex(0) {
}
#endif
} spPathConstraintPositionTimeline;

spPathConstraintPositionTimeline* spPathConstraintPositionTimeline_create (int framesCount);

void spPathConstraintPositionTimeline_setFrame (spPathConstraintPositionTimeline* self, int frameIndex, float time, float value);

#ifdef SPINE_SHORT_NAMES
typedef spPathConstraintPositionTimeline PathConstraintPositionTimeline;
#define PathConstraintPositionTimeline_create(...) spPathConstraintPositionTimeline_create(__VA_ARGS__)
#define PathConstraintPositionTimeline_setFrame(...) spPathConstraintPositionTimeline_setFrame(__VA_ARGS__)
#endif

/**/

static const int PATHCONSTRAINTSPACING_ENTRIES = 2;

typedef struct spPathConstraintSpacingTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, rotate mix, translate mix, scale mix, shear mix, ... */
int pathConstraintIndex;

#ifdef __cplusplus
spPathConstraintSpacingTimeline() :
super(),
framesCount(0),
frames(0),
pathConstraintIndex(0) {
}
#endif
} spPathConstraintSpacingTimeline;

spPathConstraintSpacingTimeline* spPathConstraintSpacingTimeline_create (int framesCount);

void spPathConstraintSpacingTimeline_setFrame (spPathConstraintSpacingTimeline* self, int frameIndex, float time, float value);

#ifdef SPINE_SHORT_NAMES
typedef spPathConstraintSpacingTimeline PathConstraintSpacingTimeline;
#define PathConstraintSpacingTimeline_create(...) spPathConstraintSpacingTimeline_create(__VA_ARGS__)
#define PathConstraintSpacingTimeline_setFrame(...) spPathConstraintSpacingTimeline_setFrame(__VA_ARGS__)
#endif

/**/

static const int PATHCONSTRAINTMIX_ENTRIES = 3;

typedef struct spPathConstraintMixTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, rotate mix, translate mix, scale mix, shear mix, ... */
int pathConstraintIndex;

#ifdef __cplusplus
spPathConstraintMixTimeline() :
super(),
framesCount(0),
frames(0),
pathConstraintIndex(0) {
}
#endif
} spPathConstraintMixTimeline;

spPathConstraintMixTimeline* spPathConstraintMixTimeline_create (int framesCount);

void spPathConstraintMixTimeline_setFrame (spPathConstraintMixTimeline* self, int frameIndex, float time, float rotateMix, float translateMix);

#ifdef SPINE_SHORT_NAMES
typedef spPathConstraintMixTimeline PathConstraintMixTimeline;
#define PathConstraintMixTimeline_create(...) spPathConstraintMixTimeline_create(__VA_ARGS__)
#define PathConstraintMixTimeline_setFrame(...) spPathConstraintMixTimeline_setFrame(__VA_ARGS__)
#endif

/**/

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 1 addition & 4 deletions spine-c/include/spine/Attachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ typedef enum {
SP_ATTACHMENT_REGION,
SP_ATTACHMENT_BOUNDING_BOX,
SP_ATTACHMENT_MESH,
SP_ATTACHMENT_WEIGHTED_MESH,
SP_ATTACHMENT_LINKED_MESH,
SP_ATTACHMENT_WEIGHTED_LINKED_MESH
SP_ATTACHMENT_PATH
} spAttachmentType;

typedef struct spAttachment {
Expand All @@ -69,9 +68,7 @@ typedef spAttachmentType AttachmentType;
#define ATTACHMENT_REGION SP_ATTACHMENT_REGION
#define ATTACHMENT_BOUNDING_BOX SP_ATTACHMENT_BOUNDING_BOX
#define ATTACHMENT_MESH SP_ATTACHMENT_MESH
#define ATTACHMENT_WEIGHTED_MESH SP_ATTACHMENT_WEIGHTED_MESH
#define ATTACHMENT_LINKED_MESH SP_ATTACHMENT_LINKED_MESH
#define ATTACHMENT_WEIGHTED_LINKED_MESH SP_ATTACHMENT_WEIGHTED_LINKED_MESH
typedef spAttachment Attachment;
#define Attachment_dispose(...) spAttachment_dispose(__VA_ARGS__)
#endif
Expand Down
22 changes: 19 additions & 3 deletions spine-c/include/spine/Bone.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,31 @@ struct spBone {
spBoneData* const data;
struct spSkeleton* const skeleton;
spBone* const parent;
int childrenCount;
spBone** const children;
float x, y, rotation, scaleX, scaleY, shearX, shearY;
float appliedRotation, appliedScaleX, appliedScaleY;
float appliedRotation;

float const a, b, worldX;
float const c, d, worldY;
float const worldSignX, worldSignY;

int/*bool*/ sorted;

#ifdef __cplusplus
spBone() :
data(0),
skeleton(0),
parent(0),
childrenCount(0), children(0),
x(0), y(0), rotation(0), scaleX(0), scaleY(0),
appliedRotation(0), appliedScaleX(0), appliedScaleY(0),
appliedRotation(0),

a(0), b(0), worldX(0),
c(0), d(0), worldY(0),
worldSignX(0), worldSignY(0) {
worldSignX(0), worldSignY(0),

sorted(0) {
}
#endif
};
Expand All @@ -84,6 +91,11 @@ float spBone_getWorldRotationY (spBone* self);
float spBone_getWorldScaleX (spBone* self);
float spBone_getWorldScaleY (spBone* self);

float spBone_worldToLocalRotationX (spBone* self);
float spBone_worldToLocalRotationY (spBone* self);
void spBone_rotateWorld (spBone* self, float degrees);
void spBone_updateLocalTransform (spBone* self);

void spBone_worldToLocal (spBone* self, float worldX, float worldY, float* localX, float* localY);
void spBone_localToWorld (spBone* self, float localX, float localY, float* worldX, float* worldY);

Expand All @@ -100,6 +112,10 @@ typedef spBone Bone;
#define Bone_getWorldRotationY(...) spBone_getWorldRotationY(__VA_ARGS__)
#define Bone_getWorldScaleX(...) spBone_getWorldScaleX(__VA_ARGS__)
#define Bone_getWorldScaleY(...) spBone_getWorldScaleY(__VA_ARGS__)
#define Bone_worldToLocalRotationX(...) spBone_worldToLocalRotationX(__VA_ARGS__)
#define Bone_worldToLocalRotationY(...) spBone_worldToLocalRotationY(__VA_ARGS__)
#define Bone_rotateWorld(...) spBone_rotateWorld(__VA_ARGS__)
#define Bone_updateLocalTransform(...) spBone_updateLocalTransform(__VA_ARGS__)
#define Bone_worldToLocal(...) spBone_worldToLocal(__VA_ARGS__)
#define Bone_localToWorld(...) spBone_localToWorld(__VA_ARGS__)
#endif
Expand Down
9 changes: 6 additions & 3 deletions spine-c/include/spine/BoneData.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,29 @@ extern "C" {

typedef struct spBoneData spBoneData;
struct spBoneData {
const int index;
const char* const name;
spBoneData* const parent;
float length;
float x, y, rotation, scaleX, scaleY, shearX, shearY;
int/*bool*/inheritScale, inheritRotation;
int/*bool*/inheritRotation, inheritScale;

#ifdef __cplusplus
spBoneData() :
index(0),
name(0),
parent(0),
length(0),
x(0), y(0),
rotation(0),
scaleX(0), scaleY(0),
inheritScale(0), inheritRotation(0) {
shearX(0), shearY(0),
inheritRotation(0), inheritScale(0) {
}
#endif
};

spBoneData* spBoneData_create (const char* name, spBoneData* parent);
spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent);
void spBoneData_dispose (spBoneData* self);

#ifdef SPINE_SHORT_NAMES
Expand Down
7 changes: 3 additions & 4 deletions spine-c/include/spine/BoundingBoxAttachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define SPINE_BOUNDINGBOXATTACHMENT_H_

#include <spine/Attachment.h>
#include <spine/VertexAttachment.h>
#include <spine/Atlas.h>
#include <spine/Slot.h>

Expand All @@ -41,13 +42,11 @@ extern "C" {
#endif

typedef struct spBoundingBoxAttachment {
spAttachment super;
int verticesCount;
float* vertices;
spVertexAttachment super;
} spBoundingBoxAttachment;

spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);
void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spBone* bone, float* vertices);
void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spSlot* slot, float* worldVertices);

#ifdef SPINE_SHORT_NAMES
typedef spBoundingBoxAttachment BoundingBoxAttachment;
Expand Down
Loading