mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[c] Introduced SP_API macro so we can use __declspec on MSVC. [ue4] Clean-up, minor improvements.
This commit is contained in:
parent
e7ae2435b0
commit
91d44b29fd
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_ANIMATION_H_
|
||||
#define SPINE_ANIMATION_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Event.h>
|
||||
#include <spine/Attachment.h>
|
||||
|
||||
@ -69,13 +70,13 @@ typedef enum {
|
||||
SP_MIX_DIRECTION_OUT
|
||||
} spMixDirection;
|
||||
|
||||
spAnimation* spAnimation_create (const char* name, int timelinesCount);
|
||||
void spAnimation_dispose (spAnimation* self);
|
||||
SP_API spAnimation* spAnimation_create (const char* name, int timelinesCount);
|
||||
SP_API 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. May be null.*/
|
||||
void spAnimation_apply (const spAnimation* self, struct spSkeleton* skeleton, float lastTime, float time, int loop,
|
||||
SP_API void spAnimation_apply (const spAnimation* self, struct spSkeleton* skeleton, float lastTime, float time, int loop,
|
||||
spEvent** events, int* eventsCount, float alpha, spMixPose pose, spMixDirection direction);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
@ -117,10 +118,10 @@ struct spTimeline {
|
||||
#endif
|
||||
};
|
||||
|
||||
void spTimeline_dispose (spTimeline* self);
|
||||
void spTimeline_apply (const spTimeline* self, struct spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
|
||||
SP_API void spTimeline_dispose (spTimeline* self);
|
||||
SP_API void spTimeline_apply (const spTimeline* self, struct spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
|
||||
int* eventsCount, float alpha, spMixPose pose, spMixDirection direction);
|
||||
int spTimeline_getPropertyId (const spTimeline* self);
|
||||
SP_API int spTimeline_getPropertyId (const spTimeline* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spTimeline Timeline;
|
||||
@ -149,14 +150,14 @@ typedef struct spCurveTimeline {
|
||||
#endif
|
||||
} spCurveTimeline;
|
||||
|
||||
void spCurveTimeline_setLinear (spCurveTimeline* self, int frameIndex);
|
||||
void spCurveTimeline_setStepped (spCurveTimeline* self, int frameIndex);
|
||||
SP_API void spCurveTimeline_setLinear (spCurveTimeline* self, int frameIndex);
|
||||
SP_API void spCurveTimeline_setStepped (spCurveTimeline* self, int frameIndex);
|
||||
|
||||
/* Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
|
||||
* cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
|
||||
* the difference between the keyframe's values. */
|
||||
void spCurveTimeline_setCurve (spCurveTimeline* self, int frameIndex, float cx1, float cy1, float cx2, float cy2);
|
||||
float spCurveTimeline_getCurvePercent (const spCurveTimeline* self, int frameIndex, float percent);
|
||||
SP_API void spCurveTimeline_setCurve (spCurveTimeline* self, int frameIndex, float cx1, float cy1, float cx2, float cy2);
|
||||
SP_API float spCurveTimeline_getCurvePercent (const spCurveTimeline* self, int frameIndex, float percent);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spCurveTimeline CurveTimeline;
|
||||
@ -192,9 +193,9 @@ static const int ROTATE_ENTRIES = 2;
|
||||
|
||||
typedef struct spBaseTimeline spRotateTimeline;
|
||||
|
||||
spRotateTimeline* spRotateTimeline_create (int framesCount);
|
||||
SP_API spRotateTimeline* spRotateTimeline_create (int framesCount);
|
||||
|
||||
void spRotateTimeline_setFrame (spRotateTimeline* self, int frameIndex, float time, float angle);
|
||||
SP_API void spRotateTimeline_setFrame (spRotateTimeline* self, int frameIndex, float time, float angle);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spRotateTimeline RotateTimeline;
|
||||
@ -208,9 +209,9 @@ static const int TRANSLATE_ENTRIES = 3;
|
||||
|
||||
typedef struct spBaseTimeline spTranslateTimeline;
|
||||
|
||||
spTranslateTimeline* spTranslateTimeline_create (int framesCount);
|
||||
SP_API spTranslateTimeline* spTranslateTimeline_create (int framesCount);
|
||||
|
||||
void spTranslateTimeline_setFrame (spTranslateTimeline* self, int frameIndex, float time, float x, float y);
|
||||
SP_API void spTranslateTimeline_setFrame (spTranslateTimeline* self, int frameIndex, float time, float x, float y);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spTranslateTimeline TranslateTimeline;
|
||||
@ -222,9 +223,9 @@ typedef spTranslateTimeline TranslateTimeline;
|
||||
|
||||
typedef struct spBaseTimeline spScaleTimeline;
|
||||
|
||||
spScaleTimeline* spScaleTimeline_create (int framesCount);
|
||||
SP_API spScaleTimeline* spScaleTimeline_create (int framesCount);
|
||||
|
||||
void spScaleTimeline_setFrame (spScaleTimeline* self, int frameIndex, float time, float x, float y);
|
||||
SP_API void spScaleTimeline_setFrame (spScaleTimeline* self, int frameIndex, float time, float x, float y);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spScaleTimeline ScaleTimeline;
|
||||
@ -236,9 +237,9 @@ typedef spScaleTimeline ScaleTimeline;
|
||||
|
||||
typedef struct spBaseTimeline spShearTimeline;
|
||||
|
||||
spShearTimeline* spShearTimeline_create (int framesCount);
|
||||
SP_API spShearTimeline* spShearTimeline_create (int framesCount);
|
||||
|
||||
void spShearTimeline_setFrame (spShearTimeline* self, int frameIndex, float time, float x, float y);
|
||||
SP_API void spShearTimeline_setFrame (spShearTimeline* self, int frameIndex, float time, float x, float y);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spShearTimeline ShearTimeline;
|
||||
@ -266,9 +267,9 @@ typedef struct spColorTimeline {
|
||||
#endif
|
||||
} spColorTimeline;
|
||||
|
||||
spColorTimeline* spColorTimeline_create (int framesCount);
|
||||
SP_API spColorTimeline* spColorTimeline_create (int framesCount);
|
||||
|
||||
void spColorTimeline_setFrame (spColorTimeline* self, int frameIndex, float time, float r, float g, float b, float a);
|
||||
SP_API void spColorTimeline_setFrame (spColorTimeline* self, int frameIndex, float time, float r, float g, float b, float a);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spColorTimeline ColorTimeline;
|
||||
@ -296,9 +297,9 @@ typedef struct spTwoColorTimeline {
|
||||
#endif
|
||||
} spTwoColorTimeline;
|
||||
|
||||
spTwoColorTimeline* spTwoColorTimeline_create (int framesCount);
|
||||
SP_API spTwoColorTimeline* spTwoColorTimeline_create (int framesCount);
|
||||
|
||||
void spTwoColorTimeline_setFrame (spTwoColorTimeline* self, int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, float b2);
|
||||
SP_API void spTwoColorTimeline_setFrame (spTwoColorTimeline* self, int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, float b2);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spTwoColorTimeline TwoColorTimeline;
|
||||
@ -326,10 +327,10 @@ typedef struct spAttachmentTimeline {
|
||||
#endif
|
||||
} spAttachmentTimeline;
|
||||
|
||||
spAttachmentTimeline* spAttachmentTimeline_create (int framesCount);
|
||||
SP_API spAttachmentTimeline* spAttachmentTimeline_create (int framesCount);
|
||||
|
||||
/* @param attachmentName May be 0. */
|
||||
void spAttachmentTimeline_setFrame (spAttachmentTimeline* self, int frameIndex, float time, const char* attachmentName);
|
||||
SP_API void spAttachmentTimeline_setFrame (spAttachmentTimeline* self, int frameIndex, float time, const char* attachmentName);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAttachmentTimeline AttachmentTimeline;
|
||||
@ -355,9 +356,9 @@ typedef struct spEventTimeline {
|
||||
#endif
|
||||
} spEventTimeline;
|
||||
|
||||
spEventTimeline* spEventTimeline_create (int framesCount);
|
||||
SP_API spEventTimeline* spEventTimeline_create (int framesCount);
|
||||
|
||||
void spEventTimeline_setFrame (spEventTimeline* self, int frameIndex, spEvent* event);
|
||||
SP_API void spEventTimeline_setFrame (spEventTimeline* self, int frameIndex, spEvent* event);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spEventTimeline EventTimeline;
|
||||
@ -385,9 +386,9 @@ typedef struct spDrawOrderTimeline {
|
||||
#endif
|
||||
} spDrawOrderTimeline;
|
||||
|
||||
spDrawOrderTimeline* spDrawOrderTimeline_create (int framesCount, int slotsCount);
|
||||
SP_API spDrawOrderTimeline* spDrawOrderTimeline_create (int framesCount, int slotsCount);
|
||||
|
||||
void spDrawOrderTimeline_setFrame (spDrawOrderTimeline* self, int frameIndex, float time, const int* drawOrder);
|
||||
SP_API void spDrawOrderTimeline_setFrame (spDrawOrderTimeline* self, int frameIndex, float time, const int* drawOrder);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spDrawOrderTimeline DrawOrderTimeline;
|
||||
@ -418,9 +419,9 @@ typedef struct spDeformTimeline {
|
||||
#endif
|
||||
} spDeformTimeline;
|
||||
|
||||
spDeformTimeline* spDeformTimeline_create (int framesCount, int frameVerticesCount);
|
||||
SP_API spDeformTimeline* spDeformTimeline_create (int framesCount, int frameVerticesCount);
|
||||
|
||||
void spDeformTimeline_setFrame (spDeformTimeline* self, int frameIndex, float time, float* vertices);
|
||||
SP_API void spDeformTimeline_setFrame (spDeformTimeline* self, int frameIndex, float time, float* vertices);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spDeformTimeline DeformTimeline;
|
||||
@ -448,9 +449,9 @@ typedef struct spIkConstraintTimeline {
|
||||
#endif
|
||||
} spIkConstraintTimeline;
|
||||
|
||||
spIkConstraintTimeline* spIkConstraintTimeline_create (int framesCount);
|
||||
SP_API spIkConstraintTimeline* spIkConstraintTimeline_create (int framesCount);
|
||||
|
||||
void spIkConstraintTimeline_setFrame (spIkConstraintTimeline* self, int frameIndex, float time, float mix, int bendDirection);
|
||||
SP_API void spIkConstraintTimeline_setFrame (spIkConstraintTimeline* self, int frameIndex, float time, float mix, int bendDirection);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spIkConstraintTimeline IkConstraintTimeline;
|
||||
@ -478,9 +479,9 @@ typedef struct spTransformConstraintTimeline {
|
||||
#endif
|
||||
} spTransformConstraintTimeline;
|
||||
|
||||
spTransformConstraintTimeline* spTransformConstraintTimeline_create (int framesCount);
|
||||
SP_API spTransformConstraintTimeline* spTransformConstraintTimeline_create (int framesCount);
|
||||
|
||||
void spTransformConstraintTimeline_setFrame (spTransformConstraintTimeline* self, int frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
|
||||
SP_API void spTransformConstraintTimeline_setFrame (spTransformConstraintTimeline* self, int frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spTransformConstraintTimeline TransformConstraintTimeline;
|
||||
@ -508,9 +509,9 @@ typedef struct spPathConstraintPositionTimeline {
|
||||
#endif
|
||||
} spPathConstraintPositionTimeline;
|
||||
|
||||
spPathConstraintPositionTimeline* spPathConstraintPositionTimeline_create (int framesCount);
|
||||
SP_API spPathConstraintPositionTimeline* spPathConstraintPositionTimeline_create (int framesCount);
|
||||
|
||||
void spPathConstraintPositionTimeline_setFrame (spPathConstraintPositionTimeline* self, int frameIndex, float time, float value);
|
||||
SP_API void spPathConstraintPositionTimeline_setFrame (spPathConstraintPositionTimeline* self, int frameIndex, float time, float value);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPathConstraintPositionTimeline PathConstraintPositionTimeline;
|
||||
@ -538,9 +539,9 @@ typedef struct spPathConstraintSpacingTimeline {
|
||||
#endif
|
||||
} spPathConstraintSpacingTimeline;
|
||||
|
||||
spPathConstraintSpacingTimeline* spPathConstraintSpacingTimeline_create (int framesCount);
|
||||
SP_API spPathConstraintSpacingTimeline* spPathConstraintSpacingTimeline_create (int framesCount);
|
||||
|
||||
void spPathConstraintSpacingTimeline_setFrame (spPathConstraintSpacingTimeline* self, int frameIndex, float time, float value);
|
||||
SP_API void spPathConstraintSpacingTimeline_setFrame (spPathConstraintSpacingTimeline* self, int frameIndex, float time, float value);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPathConstraintSpacingTimeline PathConstraintSpacingTimeline;
|
||||
@ -568,9 +569,9 @@ typedef struct spPathConstraintMixTimeline {
|
||||
#endif
|
||||
} spPathConstraintMixTimeline;
|
||||
|
||||
spPathConstraintMixTimeline* spPathConstraintMixTimeline_create (int framesCount);
|
||||
SP_API spPathConstraintMixTimeline* spPathConstraintMixTimeline_create (int framesCount);
|
||||
|
||||
void spPathConstraintMixTimeline_setFrame (spPathConstraintMixTimeline* self, int frameIndex, float time, float rotateMix, float translateMix);
|
||||
SP_API void spPathConstraintMixTimeline_setFrame (spPathConstraintMixTimeline* self, int frameIndex, float time, float rotateMix, float translateMix);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPathConstraintMixTimeline PathConstraintMixTimeline;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_ANIMATIONSTATE_H_
|
||||
#define SPINE_ANIMATIONSTATE_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Animation.h>
|
||||
#include <spine/AnimationStateData.h>
|
||||
#include <spine/Event.h>
|
||||
@ -116,38 +117,38 @@ struct spAnimationState {
|
||||
};
|
||||
|
||||
/* @param data May be 0 for no mixing. */
|
||||
spAnimationState* spAnimationState_create (spAnimationStateData* data);
|
||||
void spAnimationState_dispose (spAnimationState* self);
|
||||
SP_API spAnimationState* spAnimationState_create (spAnimationStateData* data);
|
||||
SP_API void spAnimationState_dispose (spAnimationState* self);
|
||||
|
||||
void spAnimationState_update (spAnimationState* self, float delta);
|
||||
int /**bool**/ spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);
|
||||
SP_API void spAnimationState_update (spAnimationState* self, float delta);
|
||||
SP_API int /**bool**/ spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);
|
||||
|
||||
void spAnimationState_clearTracks (spAnimationState* self);
|
||||
void spAnimationState_clearTrack (spAnimationState* self, int trackIndex);
|
||||
SP_API void spAnimationState_clearTracks (spAnimationState* self);
|
||||
SP_API void spAnimationState_clearTrack (spAnimationState* self, int trackIndex);
|
||||
|
||||
/** Set the current animation. Any queued animations are cleared. */
|
||||
spTrackEntry* spAnimationState_setAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,
|
||||
SP_API spTrackEntry* spAnimationState_setAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,
|
||||
int/*bool*/loop);
|
||||
spTrackEntry* spAnimationState_setAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop);
|
||||
SP_API spTrackEntry* spAnimationState_setAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop);
|
||||
|
||||
/** Adds an animation to be played delay seconds after the current or last queued animation, taking into account any mix
|
||||
* duration. */
|
||||
spTrackEntry* spAnimationState_addAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,
|
||||
SP_API spTrackEntry* spAnimationState_addAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,
|
||||
int/*bool*/loop, float delay);
|
||||
spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop,
|
||||
SP_API spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop,
|
||||
float delay);
|
||||
spTrackEntry* spAnimationState_setEmptyAnimation(spAnimationState* self, int trackIndex, float mixDuration);
|
||||
spTrackEntry* spAnimationState_addEmptyAnimation(spAnimationState* self, int trackIndex, float mixDuration, float delay);
|
||||
void spAnimationState_setEmptyAnimations(spAnimationState* self, float mixDuration);
|
||||
SP_API spTrackEntry* spAnimationState_setEmptyAnimation(spAnimationState* self, int trackIndex, float mixDuration);
|
||||
SP_API spTrackEntry* spAnimationState_addEmptyAnimation(spAnimationState* self, int trackIndex, float mixDuration, float delay);
|
||||
SP_API void spAnimationState_setEmptyAnimations(spAnimationState* self, float mixDuration);
|
||||
|
||||
spTrackEntry* spAnimationState_getCurrent (spAnimationState* self, int trackIndex);
|
||||
SP_API spTrackEntry* spAnimationState_getCurrent (spAnimationState* self, int trackIndex);
|
||||
|
||||
void spAnimationState_clearListenerNotifications(spAnimationState* self);
|
||||
SP_API void spAnimationState_clearListenerNotifications(spAnimationState* self);
|
||||
|
||||
float spTrackEntry_getAnimationTime (spTrackEntry* entry);
|
||||
SP_API float spTrackEntry_getAnimationTime (spTrackEntry* entry);
|
||||
|
||||
/** Use this to dispose static memory before your app exits to appease your memory leak detector*/
|
||||
void spAnimationState_disposeStatics ();
|
||||
SP_API void spAnimationState_disposeStatics ();
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spEventType EventType;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_ANIMATIONSTATEDATA_H_
|
||||
#define SPINE_ANIMATIONSTATEDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Animation.h>
|
||||
#include <spine/SkeletonData.h>
|
||||
|
||||
@ -52,13 +53,13 @@ typedef struct spAnimationStateData {
|
||||
#endif
|
||||
} spAnimationStateData;
|
||||
|
||||
spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData);
|
||||
void spAnimationStateData_dispose (spAnimationStateData* self);
|
||||
SP_API spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData);
|
||||
SP_API void spAnimationStateData_dispose (spAnimationStateData* self);
|
||||
|
||||
void spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration);
|
||||
void spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration);
|
||||
SP_API void spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration);
|
||||
SP_API void spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration);
|
||||
/* Returns 0 if there is no mixing between the animations. */
|
||||
float spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to);
|
||||
SP_API float spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAnimationStateData AnimationStateData;
|
||||
|
||||
@ -31,24 +31,26 @@
|
||||
#ifndef SPINE_ARRAY_H
|
||||
#define SPINE_ARRAY_H
|
||||
|
||||
#include <spine/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _SP_ARRAY_DECLARE_TYPE(name, itemType) \
|
||||
typedef struct name { int size; int capacity; itemType* items; } name; \
|
||||
name* name##_create(int initialCapacity); \
|
||||
void name##_dispose(name* self); \
|
||||
void name##_clear(name* self); \
|
||||
name* name##_setSize(name* self, int newSize); \
|
||||
void name##_ensureCapacity(name* self, int newCapacity); \
|
||||
void name##_add(name* self, itemType value); \
|
||||
void name##_addAll(name* self, name* other); \
|
||||
void name##_addAllValues(name* self, itemType* values, int offset, int count); \
|
||||
void name##_removeAt(name* self, int index); \
|
||||
int name##_contains(name* self, itemType value); \
|
||||
itemType name##_pop(name* self); \
|
||||
itemType name##_peek(name* self);
|
||||
SP_API name* name##_create(int initialCapacity); \
|
||||
SP_API void name##_dispose(name* self); \
|
||||
SP_API void name##_clear(name* self); \
|
||||
SP_API name* name##_setSize(name* self, int newSize); \
|
||||
SP_API void name##_ensureCapacity(name* self, int newCapacity); \
|
||||
SP_API void name##_add(name* self, itemType value); \
|
||||
SP_API void name##_addAll(name* self, name* other); \
|
||||
SP_API void name##_addAllValues(name* self, itemType* values, int offset, int count); \
|
||||
SP_API void name##_removeAt(name* self, int index); \
|
||||
SP_API int name##_contains(name* self, itemType value); \
|
||||
SP_API itemType name##_pop(name* self); \
|
||||
SP_API itemType name##_peek(name* self);
|
||||
|
||||
#define _SP_ARRAY_IMPLEMENT_TYPE(name, itemType) \
|
||||
name* name##_create(int initialCapacity) { \
|
||||
|
||||
@ -31,6 +31,8 @@
|
||||
#ifndef SPINE_ATLAS_H_
|
||||
#define SPINE_ATLAS_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -79,8 +81,8 @@ struct spAtlasPage {
|
||||
spAtlasPage* next;
|
||||
};
|
||||
|
||||
spAtlasPage* spAtlasPage_create (spAtlas* atlas, const char* name);
|
||||
void spAtlasPage_dispose (spAtlasPage* self);
|
||||
SP_API spAtlasPage* spAtlasPage_create (spAtlas* atlas, const char* name);
|
||||
SP_API void spAtlasPage_dispose (spAtlasPage* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAtlasFormat AtlasFormat;
|
||||
@ -130,8 +132,8 @@ struct spAtlasRegion {
|
||||
spAtlasRegion* next;
|
||||
};
|
||||
|
||||
spAtlasRegion* spAtlasRegion_create ();
|
||||
void spAtlasRegion_dispose (spAtlasRegion* self);
|
||||
SP_API spAtlasRegion* spAtlasRegion_create ();
|
||||
SP_API void spAtlasRegion_dispose (spAtlasRegion* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAtlasRegion AtlasRegion;
|
||||
@ -149,13 +151,13 @@ struct spAtlas {
|
||||
};
|
||||
|
||||
/* Image files referenced in the atlas file will be prefixed with dir. */
|
||||
spAtlas* spAtlas_create (const char* data, int length, const char* dir, void* rendererObject);
|
||||
SP_API spAtlas* spAtlas_create (const char* data, int length, const char* dir, void* rendererObject);
|
||||
/* Image files referenced in the atlas file will be prefixed with the directory containing the atlas file. */
|
||||
spAtlas* spAtlas_createFromFile (const char* path, void* rendererObject);
|
||||
void spAtlas_dispose (spAtlas* atlas);
|
||||
SP_API spAtlas* spAtlas_createFromFile (const char* path, void* rendererObject);
|
||||
SP_API void spAtlas_dispose (spAtlas* atlas);
|
||||
|
||||
/* Returns 0 if the region was not found. */
|
||||
spAtlasRegion* spAtlas_findRegion (const spAtlas* self, const char* name);
|
||||
SP_API spAtlasRegion* spAtlas_findRegion (const spAtlas* self, const char* name);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAtlas Atlas;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_ATLASATTACHMENTLOADER_H_
|
||||
#define SPINE_ATLASATTACHMENTLOADER_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/AttachmentLoader.h>
|
||||
#include <spine/Atlas.h>
|
||||
|
||||
@ -43,7 +44,7 @@ typedef struct spAtlasAttachmentLoader {
|
||||
spAtlas* atlas;
|
||||
} spAtlasAttachmentLoader;
|
||||
|
||||
spAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas);
|
||||
SP_API spAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAtlasAttachmentLoader AtlasAttachmentLoader;
|
||||
|
||||
@ -31,6 +31,8 @@
|
||||
#ifndef SPINE_ATTACHMENT_H_
|
||||
#define SPINE_ATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_ATTACHMENTLOADER_H_
|
||||
#define SPINE_ATTACHMENTLOADER_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/Skin.h>
|
||||
|
||||
@ -52,16 +53,16 @@ typedef struct spAttachmentLoader {
|
||||
#endif
|
||||
} spAttachmentLoader;
|
||||
|
||||
void spAttachmentLoader_dispose (spAttachmentLoader* self);
|
||||
SP_API void spAttachmentLoader_dispose (spAttachmentLoader* self);
|
||||
|
||||
/* Called to create each attachment. Returns 0 to not load an attachment. If 0 is returned and _spAttachmentLoader_setError was
|
||||
* called, an error occurred. */
|
||||
spAttachment* spAttachmentLoader_createAttachment (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name,
|
||||
SP_API spAttachment* spAttachmentLoader_createAttachment (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name,
|
||||
const char* path);
|
||||
/* Called after the attachment has been fully configured. */
|
||||
void spAttachmentLoader_configureAttachment (spAttachmentLoader* self, spAttachment* attachment);
|
||||
SP_API void spAttachmentLoader_configureAttachment (spAttachmentLoader* self, spAttachment* attachment);
|
||||
/* Called just before the attachment is disposed. This can release allocations made in spAttachmentLoader_configureAttachment. */
|
||||
void spAttachmentLoader_disposeAttachment (spAttachmentLoader* self, spAttachment* attachment);
|
||||
SP_API void spAttachmentLoader_disposeAttachment (spAttachmentLoader* self, spAttachment* attachment);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spAttachmentLoader AttachmentLoader;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_BONE_H_
|
||||
#define SPINE_BONE_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoneData.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -73,30 +74,30 @@ struct spBone {
|
||||
#endif
|
||||
};
|
||||
|
||||
void spBone_setYDown (int/*bool*/yDown);
|
||||
int/*bool*/spBone_isYDown ();
|
||||
SP_API void spBone_setYDown (int/*bool*/yDown);
|
||||
SP_API int/*bool*/spBone_isYDown ();
|
||||
|
||||
/* @param parent May be 0. */
|
||||
spBone* spBone_create (spBoneData* data, struct spSkeleton* skeleton, spBone* parent);
|
||||
void spBone_dispose (spBone* self);
|
||||
SP_API spBone* spBone_create (spBoneData* data, struct spSkeleton* skeleton, spBone* parent);
|
||||
SP_API void spBone_dispose (spBone* self);
|
||||
|
||||
void spBone_setToSetupPose (spBone* self);
|
||||
SP_API void spBone_setToSetupPose (spBone* self);
|
||||
|
||||
void spBone_updateWorldTransform (spBone* self);
|
||||
void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY);
|
||||
SP_API void spBone_updateWorldTransform (spBone* self);
|
||||
SP_API void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY);
|
||||
|
||||
float spBone_getWorldRotationX (spBone* self);
|
||||
float spBone_getWorldRotationY (spBone* self);
|
||||
float spBone_getWorldScaleX (spBone* self);
|
||||
float spBone_getWorldScaleY (spBone* self);
|
||||
SP_API float spBone_getWorldRotationX (spBone* self);
|
||||
SP_API float spBone_getWorldRotationY (spBone* self);
|
||||
SP_API float spBone_getWorldScaleX (spBone* self);
|
||||
SP_API float spBone_getWorldScaleY (spBone* self);
|
||||
|
||||
void spBone_updateAppliedTransform (spBone* self);
|
||||
SP_API void spBone_updateAppliedTransform (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);
|
||||
float spBone_worldToLocalRotation (spBone* self, float worldRotation);
|
||||
float spBone_localToWorldRotation (spBone* self, float localRotation);
|
||||
void spBone_rotateWorld (spBone* self, float degrees);
|
||||
SP_API void spBone_worldToLocal (spBone* self, float worldX, float worldY, float* localX, float* localY);
|
||||
SP_API void spBone_localToWorld (spBone* self, float localX, float localY, float* worldX, float* worldY);
|
||||
SP_API float spBone_worldToLocalRotation (spBone* self, float worldRotation);
|
||||
SP_API float spBone_localToWorldRotation (spBone* self, float localRotation);
|
||||
SP_API void spBone_rotateWorld (spBone* self, float degrees);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spBone Bone;
|
||||
|
||||
@ -31,6 +31,8 @@
|
||||
#ifndef SPINE_BONEDATA_H_
|
||||
#define SPINE_BONEDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -67,8 +69,8 @@ struct spBoneData {
|
||||
#endif
|
||||
};
|
||||
|
||||
spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent);
|
||||
void spBoneData_dispose (spBoneData* self);
|
||||
SP_API spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent);
|
||||
SP_API void spBoneData_dispose (spBoneData* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spBoneData BoneData;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_BOUNDINGBOXATTACHMENT_H_
|
||||
#define SPINE_BOUNDINGBOXATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/VertexAttachment.h>
|
||||
#include <spine/Atlas.h>
|
||||
@ -44,7 +45,7 @@ typedef struct spBoundingBoxAttachment {
|
||||
spVertexAttachment super;
|
||||
} spBoundingBoxAttachment;
|
||||
|
||||
spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);
|
||||
SP_API spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spBoundingBoxAttachment BoundingBoxAttachment;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_CLIPPINGATTACHMENT_H_
|
||||
#define SPINE_CLIPPINGATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/VertexAttachment.h>
|
||||
#include <spine/Atlas.h>
|
||||
@ -45,8 +46,8 @@ typedef struct spClippingAttachment {
|
||||
spSlotData* endSlot;
|
||||
} spClippingAttachment;
|
||||
|
||||
void _spClippingAttachment_dispose(spAttachment* self);
|
||||
spClippingAttachment* spClippingAttachment_create (const char* name);
|
||||
SP_API void _spClippingAttachment_dispose(spAttachment* self);
|
||||
SP_API spClippingAttachment* spClippingAttachment_create (const char* name);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spClippingAttachment ClippingAttachment;
|
||||
|
||||
@ -31,6 +31,8 @@
|
||||
#ifndef SPINE_COLOR_H_
|
||||
#define SPINE_COLOR_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -50,13 +52,13 @@ typedef struct spColor {
|
||||
} spColor;
|
||||
|
||||
/* @param attachmentName May be 0 for no setup pose attachment. */
|
||||
spColor* spColor_create();
|
||||
void spColor_dispose(spColor* self);
|
||||
void spColor_setFromFloats(spColor* color, float r, float g, float b, float a);
|
||||
void spColor_setFromColor(spColor* color, spColor* otherColor);
|
||||
void spColor_addFloats(spColor* color, float r, float g, float b, float a);
|
||||
void spColor_addColor(spColor* color, spColor* otherColor);
|
||||
void spColor_clamp(spColor* color);
|
||||
SP_API spColor* spColor_create();
|
||||
SP_API void spColor_dispose(spColor* self);
|
||||
SP_API void spColor_setFromFloats(spColor* color, float r, float g, float b, float a);
|
||||
SP_API void spColor_setFromColor(spColor* color, spColor* otherColor);
|
||||
SP_API void spColor_addFloats(spColor* color, float r, float g, float b, float a);
|
||||
SP_API void spColor_addColor(spColor* color, spColor* otherColor);
|
||||
SP_API void spColor_clamp(spColor* color);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spColor color;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_EVENT_H_
|
||||
#define SPINE_EVENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/EventData.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -55,8 +56,8 @@ typedef struct spEvent {
|
||||
#endif
|
||||
} spEvent;
|
||||
|
||||
spEvent* spEvent_create (float time, spEventData* data);
|
||||
void spEvent_dispose (spEvent* self);
|
||||
SP_API spEvent* spEvent_create (float time, spEventData* data);
|
||||
SP_API void spEvent_dispose (spEvent* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spEvent Event;
|
||||
|
||||
@ -31,6 +31,8 @@
|
||||
#ifndef SPINE_EVENTDATA_H_
|
||||
#define SPINE_EVENTDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -51,8 +53,8 @@ typedef struct spEventData {
|
||||
#endif
|
||||
} spEventData;
|
||||
|
||||
spEventData* spEventData_create (const char* name);
|
||||
void spEventData_dispose (spEventData* self);
|
||||
SP_API spEventData* spEventData_create (const char* name);
|
||||
SP_API void spEventData_dispose (spEventData* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spEventData EventData;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_IKCONSTRAINT_H_
|
||||
#define SPINE_IKCONSTRAINT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/IkConstraintData.h>
|
||||
#include <spine/Bone.h>
|
||||
|
||||
@ -62,13 +63,13 @@ typedef struct spIkConstraint {
|
||||
#endif
|
||||
} spIkConstraint;
|
||||
|
||||
spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton);
|
||||
void spIkConstraint_dispose (spIkConstraint* self);
|
||||
SP_API spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton);
|
||||
SP_API void spIkConstraint_dispose (spIkConstraint* self);
|
||||
|
||||
void spIkConstraint_apply (spIkConstraint* self);
|
||||
SP_API void spIkConstraint_apply (spIkConstraint* self);
|
||||
|
||||
void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float alpha);
|
||||
void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float targetY, int bendDirection, float alpha);
|
||||
SP_API void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float alpha);
|
||||
SP_API void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float targetY, int bendDirection, float alpha);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spIkConstraint IkConstraint;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_IKCONSTRAINTDATA_H_
|
||||
#define SPINE_IKCONSTRAINTDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoneData.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -59,8 +60,8 @@ typedef struct spIkConstraintData {
|
||||
#endif
|
||||
} spIkConstraintData;
|
||||
|
||||
spIkConstraintData* spIkConstraintData_create (const char* name);
|
||||
void spIkConstraintData_dispose (spIkConstraintData* self);
|
||||
SP_API spIkConstraintData* spIkConstraintData_create (const char* name);
|
||||
SP_API void spIkConstraintData_dispose (spIkConstraintData* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spIkConstraintData IkConstraintData;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_MESHATTACHMENT_H_
|
||||
#define SPINE_MESHATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/VertexAttachment.h>
|
||||
#include <spine/Atlas.h>
|
||||
@ -72,9 +73,9 @@ struct spMeshAttachment {
|
||||
float width, height;
|
||||
};
|
||||
|
||||
spMeshAttachment* spMeshAttachment_create (const char* name);
|
||||
void spMeshAttachment_updateUVs (spMeshAttachment* self);
|
||||
void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* parentMesh);
|
||||
SP_API spMeshAttachment* spMeshAttachment_create (const char* name);
|
||||
SP_API void spMeshAttachment_updateUVs (spMeshAttachment* self);
|
||||
SP_API void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* parentMesh);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spMeshAttachment MeshAttachment;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_PATHATTACHMENT_H_
|
||||
#define SPINE_PATHATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/VertexAttachment.h>
|
||||
#include <spine/Atlas.h>
|
||||
@ -47,7 +48,7 @@ typedef struct spPathAttachment {
|
||||
int/*bool*/ closed, constantSpeed;
|
||||
} spPathAttachment;
|
||||
|
||||
spPathAttachment* spPathAttachment_create (const char* name);
|
||||
SP_API spPathAttachment* spPathAttachment_create (const char* name);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPathAttachment PathAttachment;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_PATHCONSTRAINT_H_
|
||||
#define SPINE_PATHCONSTRAINT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/PathConstraintData.h>
|
||||
#include <spine/Bone.h>
|
||||
#include <spine/Slot.h>
|
||||
@ -92,11 +93,11 @@ typedef struct spPathConstraint {
|
||||
|
||||
#define SP_PATHCONSTRAINT_
|
||||
|
||||
spPathConstraint* spPathConstraint_create (spPathConstraintData* data, const struct spSkeleton* skeleton);
|
||||
void spPathConstraint_dispose (spPathConstraint* self);
|
||||
SP_API spPathConstraint* spPathConstraint_create (spPathConstraintData* data, const struct spSkeleton* skeleton);
|
||||
SP_API void spPathConstraint_dispose (spPathConstraint* self);
|
||||
|
||||
void spPathConstraint_apply (spPathConstraint* self);
|
||||
float* spPathConstraint_computeWorldPositions(spPathConstraint* self, spPathAttachment* path, int spacesCount, int/*bool*/ tangents, int/*bool*/percentPosition, int/**/percentSpacing);
|
||||
SP_API void spPathConstraint_apply (spPathConstraint* self);
|
||||
SP_API float* spPathConstraint_computeWorldPositions(spPathConstraint* self, spPathAttachment* path, int spacesCount, int/*bool*/ tangents, int/*bool*/percentPosition, int/**/percentSpacing);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPathConstraint PathConstraint;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_PATHCONSTRAINTDATA_H_
|
||||
#define SPINE_PATHCONSTRAINTDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoneData.h>
|
||||
#include <spine/SlotData.h>
|
||||
|
||||
@ -80,8 +81,8 @@ typedef struct spPathConstraintData {
|
||||
#endif
|
||||
} spPathConstraintData;
|
||||
|
||||
spPathConstraintData* spPathConstraintData_create (const char* name);
|
||||
void spPathConstraintData_dispose (spPathConstraintData* self);
|
||||
SP_API spPathConstraintData* spPathConstraintData_create (const char* name);
|
||||
SP_API void spPathConstraintData_dispose (spPathConstraintData* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPathConstraintData PathConstraintData;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_POINTATTACHMENT_H_
|
||||
#define SPINE_POINTATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/VertexAttachment.h>
|
||||
#include <spine/Atlas.h>
|
||||
@ -46,9 +47,9 @@ typedef struct spPointAttachment {
|
||||
spColor color;
|
||||
} spPointAttachment;
|
||||
|
||||
spPointAttachment* spPointAttachment_create (const char* name);
|
||||
void spPointAttachment_computeWorldPosition (spPointAttachment* self, spBone* bone, float* x, float* y);
|
||||
float spPointAttachment_computeWorldRotation (spPointAttachment* self, spBone* bone);
|
||||
SP_API spPointAttachment* spPointAttachment_create (const char* name);
|
||||
SP_API void spPointAttachment_computeWorldPosition (spPointAttachment* self, spBone* bone, float* x, float* y);
|
||||
SP_API float spPointAttachment_computeWorldRotation (spPointAttachment* self, spBone* bone);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPointAttachment PointAttachment;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_REGIONATTACHMENT_H_
|
||||
#define SPINE_REGIONATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/Atlas.h>
|
||||
#include <spine/Slot.h>
|
||||
@ -54,10 +55,10 @@ typedef struct spRegionAttachment {
|
||||
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);
|
||||
void spRegionAttachment_updateOffset (spRegionAttachment* self);
|
||||
void spRegionAttachment_computeWorldVertices (spRegionAttachment* self, spBone* bone, float* vertices, int offset, int stride);
|
||||
SP_API spRegionAttachment* spRegionAttachment_create (const char* name);
|
||||
SP_API void spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate);
|
||||
SP_API void spRegionAttachment_updateOffset (spRegionAttachment* self);
|
||||
SP_API void spRegionAttachment_computeWorldVertices (spRegionAttachment* self, spBone* bone, float* vertices, int offset, int stride);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spRegionAttachment RegionAttachment;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKELETON_H_
|
||||
#define SPINE_SKELETON_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/SkeletonData.h>
|
||||
#include <spine/Slot.h>
|
||||
#include <spine/Skin.h>
|
||||
@ -94,57 +95,57 @@ typedef struct spSkeleton {
|
||||
#endif
|
||||
} spSkeleton;
|
||||
|
||||
spSkeleton* spSkeleton_create (spSkeletonData* data);
|
||||
void spSkeleton_dispose (spSkeleton* self);
|
||||
SP_API spSkeleton* spSkeleton_create (spSkeletonData* data);
|
||||
SP_API void spSkeleton_dispose (spSkeleton* self);
|
||||
|
||||
/* Caches information about bones and constraints. Must be called if bones or constraints, or weighted path attachments
|
||||
* are added or removed. */
|
||||
void spSkeleton_updateCache (spSkeleton* self);
|
||||
void spSkeleton_updateWorldTransform (const spSkeleton* self);
|
||||
SP_API void spSkeleton_updateCache (spSkeleton* self);
|
||||
SP_API void spSkeleton_updateWorldTransform (const spSkeleton* self);
|
||||
|
||||
/* Sets the bones, constraints, and slots to their setup pose values. */
|
||||
void spSkeleton_setToSetupPose (const spSkeleton* self);
|
||||
SP_API void spSkeleton_setToSetupPose (const spSkeleton* self);
|
||||
/* Sets the bones and constraints to their setup pose values. */
|
||||
void spSkeleton_setBonesToSetupPose (const spSkeleton* self);
|
||||
void spSkeleton_setSlotsToSetupPose (const spSkeleton* self);
|
||||
SP_API void spSkeleton_setBonesToSetupPose (const spSkeleton* self);
|
||||
SP_API void spSkeleton_setSlotsToSetupPose (const spSkeleton* self);
|
||||
|
||||
/* Returns 0 if the bone was not found. */
|
||||
spBone* spSkeleton_findBone (const spSkeleton* self, const char* boneName);
|
||||
SP_API spBone* spSkeleton_findBone (const spSkeleton* self, const char* boneName);
|
||||
/* Returns -1 if the bone was not found. */
|
||||
int spSkeleton_findBoneIndex (const spSkeleton* self, const char* boneName);
|
||||
SP_API int spSkeleton_findBoneIndex (const spSkeleton* self, const char* boneName);
|
||||
|
||||
/* Returns 0 if the slot was not found. */
|
||||
spSlot* spSkeleton_findSlot (const spSkeleton* self, const char* slotName);
|
||||
SP_API spSlot* spSkeleton_findSlot (const spSkeleton* self, const char* slotName);
|
||||
/* Returns -1 if the slot was not found. */
|
||||
int spSkeleton_findSlotIndex (const spSkeleton* self, const char* slotName);
|
||||
SP_API int spSkeleton_findSlotIndex (const spSkeleton* self, const char* slotName);
|
||||
|
||||
/* Sets the skin used to look up attachments before looking in the SkeletonData defaultSkin. Attachments from the new skin are
|
||||
* attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode
|
||||
* attachment is attached from the new skin.
|
||||
* @param skin May be 0.*/
|
||||
void spSkeleton_setSkin (spSkeleton* self, spSkin* skin);
|
||||
SP_API void spSkeleton_setSkin (spSkeleton* self, spSkin* skin);
|
||||
/* Returns 0 if the skin was not found. See spSkeleton_setSkin.
|
||||
* @param skinName May be 0. */
|
||||
int spSkeleton_setSkinByName (spSkeleton* self, const char* skinName);
|
||||
SP_API int spSkeleton_setSkinByName (spSkeleton* self, const char* skinName);
|
||||
|
||||
/* Returns 0 if the slot or attachment was not found. */
|
||||
spAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName);
|
||||
SP_API spAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName);
|
||||
/* Returns 0 if the slot or attachment was not found. */
|
||||
spAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName);
|
||||
SP_API spAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName);
|
||||
/* Returns 0 if the slot or attachment was not found.
|
||||
* @param attachmentName May be 0. */
|
||||
int spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName);
|
||||
SP_API int spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName);
|
||||
|
||||
/* Returns 0 if the IK constraint was not found. */
|
||||
spIkConstraint* spSkeleton_findIkConstraint (const spSkeleton* self, const char* constraintName);
|
||||
SP_API spIkConstraint* spSkeleton_findIkConstraint (const spSkeleton* self, const char* constraintName);
|
||||
|
||||
/* Returns 0 if the transform constraint was not found. */
|
||||
spTransformConstraint* spSkeleton_findTransformConstraint (const spSkeleton* self, const char* constraintName);
|
||||
SP_API spTransformConstraint* spSkeleton_findTransformConstraint (const spSkeleton* self, const char* constraintName);
|
||||
|
||||
/* Returns 0 if the path constraint was not found. */
|
||||
spPathConstraint* spSkeleton_findPathConstraint (const spSkeleton* self, const char* constraintName);
|
||||
SP_API spPathConstraint* spSkeleton_findPathConstraint (const spSkeleton* self, const char* constraintName);
|
||||
|
||||
void spSkeleton_update (spSkeleton* self, float deltaTime);
|
||||
SP_API void spSkeleton_update (spSkeleton* self, float deltaTime);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSkeleton Skeleton;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKELETONBINARY_H_
|
||||
#define SPINE_SKELETONBINARY_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/AttachmentLoader.h>
|
||||
#include <spine/SkeletonData.h>
|
||||
@ -48,12 +49,12 @@ typedef struct spSkeletonBinary {
|
||||
const char* const error;
|
||||
} spSkeletonBinary;
|
||||
|
||||
spSkeletonBinary* spSkeletonBinary_createWithLoader (spAttachmentLoader* attachmentLoader);
|
||||
spSkeletonBinary* spSkeletonBinary_create (spAtlas* atlas);
|
||||
void spSkeletonBinary_dispose (spSkeletonBinary* self);
|
||||
SP_API spSkeletonBinary* spSkeletonBinary_createWithLoader (spAttachmentLoader* attachmentLoader);
|
||||
SP_API spSkeletonBinary* spSkeletonBinary_create (spAtlas* atlas);
|
||||
SP_API void spSkeletonBinary_dispose (spSkeletonBinary* self);
|
||||
|
||||
spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const unsigned char* binary, const int length);
|
||||
spSkeletonData* spSkeletonBinary_readSkeletonDataFile (spSkeletonBinary* self, const char* path);
|
||||
SP_API spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const unsigned char* binary, const int length);
|
||||
SP_API spSkeletonData* spSkeletonBinary_readSkeletonDataFile (spSkeletonBinary* self, const char* path);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSkeletonBinary SkeletonBinary;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKELETONBOUNDS_H_
|
||||
#define SPINE_SKELETONBOUNDS_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoundingBoxAttachment.h>
|
||||
#include <spine/Skeleton.h>
|
||||
|
||||
@ -44,11 +45,11 @@ typedef struct spPolygon {
|
||||
int capacity;
|
||||
} spPolygon;
|
||||
|
||||
spPolygon* spPolygon_create (int capacity);
|
||||
void spPolygon_dispose (spPolygon* self);
|
||||
SP_API spPolygon* spPolygon_create (int capacity);
|
||||
SP_API void spPolygon_dispose (spPolygon* self);
|
||||
|
||||
int/*bool*/spPolygon_containsPoint (spPolygon* polygon, float x, float y);
|
||||
int/*bool*/spPolygon_intersectsSegment (spPolygon* polygon, float x1, float y1, float x2, float y2);
|
||||
SP_API int/*bool*/spPolygon_containsPoint (spPolygon* polygon, float x, float y);
|
||||
SP_API int/*bool*/spPolygon_intersectsSegment (spPolygon* polygon, float x1, float y1, float x2, float y2);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spPolygon Polygon;
|
||||
@ -68,29 +69,29 @@ typedef struct spSkeletonBounds {
|
||||
float minX, minY, maxX, maxY;
|
||||
} spSkeletonBounds;
|
||||
|
||||
spSkeletonBounds* spSkeletonBounds_create ();
|
||||
void spSkeletonBounds_dispose (spSkeletonBounds* self);
|
||||
void spSkeletonBounds_update (spSkeletonBounds* self, spSkeleton* skeleton, int/*bool*/updateAabb);
|
||||
SP_API spSkeletonBounds* spSkeletonBounds_create ();
|
||||
SP_API void spSkeletonBounds_dispose (spSkeletonBounds* self);
|
||||
SP_API void spSkeletonBounds_update (spSkeletonBounds* self, spSkeleton* skeleton, int/*bool*/updateAabb);
|
||||
|
||||
/** Returns true if the axis aligned bounding box contains the point. */
|
||||
int/*bool*/spSkeletonBounds_aabbContainsPoint (spSkeletonBounds* self, float x, float y);
|
||||
SP_API int/*bool*/spSkeletonBounds_aabbContainsPoint (spSkeletonBounds* self, float x, float y);
|
||||
|
||||
/** Returns true if the axis aligned bounding box intersects the line segment. */
|
||||
int/*bool*/spSkeletonBounds_aabbIntersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2);
|
||||
SP_API int/*bool*/spSkeletonBounds_aabbIntersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2);
|
||||
|
||||
/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */
|
||||
int/*bool*/spSkeletonBounds_aabbIntersectsSkeleton (spSkeletonBounds* self, spSkeletonBounds* bounds);
|
||||
SP_API int/*bool*/spSkeletonBounds_aabbIntersectsSkeleton (spSkeletonBounds* self, spSkeletonBounds* bounds);
|
||||
|
||||
/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more
|
||||
* efficient to only call this method if spSkeletonBounds_aabbContainsPoint returns true. */
|
||||
spBoundingBoxAttachment* spSkeletonBounds_containsPoint (spSkeletonBounds* self, float x, float y);
|
||||
SP_API spBoundingBoxAttachment* spSkeletonBounds_containsPoint (spSkeletonBounds* self, float x, float y);
|
||||
|
||||
/** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually
|
||||
* more efficient to only call this method if spSkeletonBounds_aabbIntersectsSegment returns true. */
|
||||
spBoundingBoxAttachment* spSkeletonBounds_intersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2);
|
||||
SP_API spBoundingBoxAttachment* spSkeletonBounds_intersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2);
|
||||
|
||||
/** Returns the polygon for the specified bounding box, or null. */
|
||||
spPolygon* spSkeletonBounds_getPolygon (spSkeletonBounds* self, spBoundingBoxAttachment* boundingBox);
|
||||
SP_API spPolygon* spSkeletonBounds_getPolygon (spSkeletonBounds* self, spBoundingBoxAttachment* boundingBox);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSkeletonBounds SkeletonBounds;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKELETONCLIPPING_H
|
||||
#define SPINE_SKELETONCLIPPING_H
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Array.h>
|
||||
#include <spine/ClippingAttachment.h>
|
||||
#include <spine/Slot.h>
|
||||
@ -52,13 +53,13 @@ typedef struct spSkeletonClipping {
|
||||
spArrayFloatArray* clippingPolygons;
|
||||
} spSkeletonClipping;
|
||||
|
||||
spSkeletonClipping* spSkeletonClipping_create();
|
||||
int spSkeletonClipping_clipStart(spSkeletonClipping* self, spSlot* slot, spClippingAttachment* clip);
|
||||
void spSkeletonClipping_clipEnd(spSkeletonClipping* self, spSlot* slot);
|
||||
void spSkeletonClipping_clipEnd2(spSkeletonClipping* self);
|
||||
int /*boolean*/ spSkeletonClipping_isClipping(spSkeletonClipping* self);
|
||||
void spSkeletonClipping_clipTriangles(spSkeletonClipping* self, float* vertices, int verticesLength, unsigned short* triangles, int trianglesLength, float* uvs, int stride);
|
||||
void spSkeletonClipping_dispose(spSkeletonClipping* self);
|
||||
SP_API spSkeletonClipping* spSkeletonClipping_create();
|
||||
SP_API int spSkeletonClipping_clipStart(spSkeletonClipping* self, spSlot* slot, spClippingAttachment* clip);
|
||||
SP_API void spSkeletonClipping_clipEnd(spSkeletonClipping* self, spSlot* slot);
|
||||
SP_API void spSkeletonClipping_clipEnd2(spSkeletonClipping* self);
|
||||
SP_API int /*boolean*/ spSkeletonClipping_isClipping(spSkeletonClipping* self);
|
||||
SP_API void spSkeletonClipping_clipTriangles(spSkeletonClipping* self, float* vertices, int verticesLength, unsigned short* triangles, int trianglesLength, float* uvs, int stride);
|
||||
SP_API void spSkeletonClipping_dispose(spSkeletonClipping* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKELETONDATA_H_
|
||||
#define SPINE_SKELETONDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoneData.h>
|
||||
#include <spine/SlotData.h>
|
||||
#include <spine/Skin.h>
|
||||
@ -75,26 +76,26 @@ typedef struct spSkeletonData {
|
||||
spPathConstraintData** pathConstraints;
|
||||
} spSkeletonData;
|
||||
|
||||
spSkeletonData* spSkeletonData_create ();
|
||||
void spSkeletonData_dispose (spSkeletonData* self);
|
||||
SP_API spSkeletonData* spSkeletonData_create ();
|
||||
SP_API void spSkeletonData_dispose (spSkeletonData* self);
|
||||
|
||||
spBoneData* spSkeletonData_findBone (const spSkeletonData* self, const char* boneName);
|
||||
int spSkeletonData_findBoneIndex (const spSkeletonData* self, const char* boneName);
|
||||
SP_API spBoneData* spSkeletonData_findBone (const spSkeletonData* self, const char* boneName);
|
||||
SP_API int spSkeletonData_findBoneIndex (const spSkeletonData* self, const char* boneName);
|
||||
|
||||
spSlotData* spSkeletonData_findSlot (const spSkeletonData* self, const char* slotName);
|
||||
int spSkeletonData_findSlotIndex (const spSkeletonData* self, const char* slotName);
|
||||
SP_API spSlotData* spSkeletonData_findSlot (const spSkeletonData* self, const char* slotName);
|
||||
SP_API int spSkeletonData_findSlotIndex (const spSkeletonData* self, const char* slotName);
|
||||
|
||||
spSkin* spSkeletonData_findSkin (const spSkeletonData* self, const char* skinName);
|
||||
SP_API spSkin* spSkeletonData_findSkin (const spSkeletonData* self, const char* skinName);
|
||||
|
||||
spEventData* spSkeletonData_findEvent (const spSkeletonData* self, const char* eventName);
|
||||
SP_API spEventData* spSkeletonData_findEvent (const spSkeletonData* self, const char* eventName);
|
||||
|
||||
spAnimation* spSkeletonData_findAnimation (const spSkeletonData* self, const char* animationName);
|
||||
SP_API spAnimation* spSkeletonData_findAnimation (const spSkeletonData* self, const char* animationName);
|
||||
|
||||
spIkConstraintData* spSkeletonData_findIkConstraint (const spSkeletonData* self, const char* constraintName);
|
||||
SP_API spIkConstraintData* spSkeletonData_findIkConstraint (const spSkeletonData* self, const char* constraintName);
|
||||
|
||||
spTransformConstraintData* spSkeletonData_findTransformConstraint (const spSkeletonData* self, const char* constraintName);
|
||||
SP_API spTransformConstraintData* spSkeletonData_findTransformConstraint (const spSkeletonData* self, const char* constraintName);
|
||||
|
||||
spPathConstraintData* spSkeletonData_findPathConstraint (const spSkeletonData* self, const char* constraintName);
|
||||
SP_API spPathConstraintData* spSkeletonData_findPathConstraint (const spSkeletonData* self, const char* constraintName);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSkeletonData SkeletonData;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKELETONJSON_H_
|
||||
#define SPINE_SKELETONJSON_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/AttachmentLoader.h>
|
||||
#include <spine/SkeletonData.h>
|
||||
@ -49,12 +50,12 @@ typedef struct spSkeletonJson {
|
||||
const char* const error;
|
||||
} spSkeletonJson;
|
||||
|
||||
spSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader);
|
||||
spSkeletonJson* spSkeletonJson_create (spAtlas* atlas);
|
||||
void spSkeletonJson_dispose (spSkeletonJson* self);
|
||||
SP_API spSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader);
|
||||
SP_API spSkeletonJson* spSkeletonJson_create (spAtlas* atlas);
|
||||
SP_API void spSkeletonJson_dispose (spSkeletonJson* self);
|
||||
|
||||
spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json);
|
||||
spSkeletonData* spSkeletonJson_readSkeletonDataFile (spSkeletonJson* self, const char* path);
|
||||
SP_API spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json);
|
||||
SP_API spSkeletonData* spSkeletonJson_readSkeletonDataFile (spSkeletonJson* self, const char* path);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSkeletonJson SkeletonJson;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SKIN_H_
|
||||
#define SPINE_SKIN_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -63,19 +64,19 @@ typedef struct {
|
||||
_Entry* entries;
|
||||
} _spSkin;
|
||||
|
||||
spSkin* spSkin_create (const char* name);
|
||||
void spSkin_dispose (spSkin* self);
|
||||
SP_API spSkin* spSkin_create (const char* name);
|
||||
SP_API void spSkin_dispose (spSkin* self);
|
||||
|
||||
/* The Skin owns the attachment. */
|
||||
void spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment);
|
||||
SP_API void spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment);
|
||||
/* Returns 0 if the attachment was not found. */
|
||||
spAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name);
|
||||
SP_API spAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name);
|
||||
|
||||
/* Returns 0 if the slot or attachment was not found. */
|
||||
const char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex);
|
||||
SP_API const char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex);
|
||||
|
||||
/** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */
|
||||
void spSkin_attachAll (const spSkin* self, struct spSkeleton* skeleton, const spSkin* oldspSkin);
|
||||
SP_API void spSkin_attachAll (const spSkin* self, struct spSkeleton* skeleton, const spSkin* oldspSkin);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSkin Skin;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SLOT_H_
|
||||
#define SPINE_SLOT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Bone.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/SlotData.h>
|
||||
@ -64,16 +65,16 @@ typedef struct spSlot {
|
||||
#endif
|
||||
} spSlot;
|
||||
|
||||
spSlot* spSlot_create (spSlotData* data, spBone* bone);
|
||||
void spSlot_dispose (spSlot* self);
|
||||
SP_API spSlot* spSlot_create (spSlotData* data, spBone* bone);
|
||||
SP_API void spSlot_dispose (spSlot* self);
|
||||
|
||||
/* @param attachment May be 0 to clear the attachment for the slot. */
|
||||
void spSlot_setAttachment (spSlot* self, spAttachment* attachment);
|
||||
SP_API void spSlot_setAttachment (spSlot* self, spAttachment* attachment);
|
||||
|
||||
void spSlot_setAttachmentTime (spSlot* self, float time);
|
||||
float spSlot_getAttachmentTime (const spSlot* self);
|
||||
SP_API void spSlot_setAttachmentTime (spSlot* self, float time);
|
||||
SP_API float spSlot_getAttachmentTime (const spSlot* self);
|
||||
|
||||
void spSlot_setToSetupPose (spSlot* self);
|
||||
SP_API void spSlot_setToSetupPose (spSlot* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spSlot Slot;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SLOTDATA_H_
|
||||
#define SPINE_SLOTDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoneData.h>
|
||||
#include <spine/Color.h>
|
||||
|
||||
@ -64,11 +65,11 @@ typedef struct spSlotData {
|
||||
#endif
|
||||
} spSlotData;
|
||||
|
||||
spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData);
|
||||
void spSlotData_dispose (spSlotData* self);
|
||||
SP_API spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData);
|
||||
SP_API void spSlotData_dispose (spSlotData* self);
|
||||
|
||||
/* @param attachmentName May be 0 for no setup pose attachment. */
|
||||
void spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName);
|
||||
SP_API void spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spBlendMode BlendMode;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_TRANSFORMCONSTRAINT_H_
|
||||
#define SPINE_TRANSFORMCONSTRAINT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/TransformConstraintData.h>
|
||||
#include <spine/Bone.h>
|
||||
|
||||
@ -61,10 +62,10 @@ typedef struct spTransformConstraint {
|
||||
#endif
|
||||
} spTransformConstraint;
|
||||
|
||||
spTransformConstraint* spTransformConstraint_create (spTransformConstraintData* data, const struct spSkeleton* skeleton);
|
||||
void spTransformConstraint_dispose (spTransformConstraint* self);
|
||||
SP_API spTransformConstraint* spTransformConstraint_create (spTransformConstraintData* data, const struct spSkeleton* skeleton);
|
||||
SP_API void spTransformConstraint_dispose (spTransformConstraint* self);
|
||||
|
||||
void spTransformConstraint_apply (spTransformConstraint* self);
|
||||
SP_API void spTransformConstraint_apply (spTransformConstraint* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spTransformConstraint TransformConstraint;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_TRANSFORMCONSTRAINTDATA_H_
|
||||
#define SPINE_TRANSFORMCONSTRAINTDATA_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/BoneData.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -70,8 +71,8 @@ typedef struct spTransformConstraintData {
|
||||
#endif
|
||||
} spTransformConstraintData;
|
||||
|
||||
spTransformConstraintData* spTransformConstraintData_create (const char* name);
|
||||
void spTransformConstraintData_dispose (spTransformConstraintData* self);
|
||||
SP_API spTransformConstraintData* spTransformConstraintData_create (const char* name);
|
||||
SP_API void spTransformConstraintData_dispose (spTransformConstraintData* self);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spTransformConstraintData TransformConstraintData;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_TRIANGULATOR_H
|
||||
#define SPINE_TRIANGULATOR_H
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Array.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -49,10 +50,10 @@ typedef struct spTriangulator {
|
||||
spArrayShortArray* polygonIndicesPool;
|
||||
} spTriangulator;
|
||||
|
||||
spTriangulator* spTriangulator_create();
|
||||
spShortArray* spTriangulator_triangulate(spTriangulator* self, spFloatArray* verticesArray);
|
||||
spArrayFloatArray* spTriangulator_decompose(spTriangulator* self, spFloatArray* verticesArray, spShortArray* triangles);
|
||||
void spTriangulator_dispose(spTriangulator* self);
|
||||
SP_API spTriangulator* spTriangulator_create();
|
||||
SP_API spShortArray* spTriangulator_triangulate(spTriangulator* self, spFloatArray* verticesArray);
|
||||
SP_API spArrayFloatArray* spTriangulator_decompose(spTriangulator* self, spFloatArray* verticesArray, spShortArray* triangles);
|
||||
SP_API void spTriangulator_dispose(spTriangulator* self);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_VERTEXATTACHMENT_H_
|
||||
#define SPINE_VERTEXATTACHMENT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Attachment.h>
|
||||
#include <spine/Slot.h>
|
||||
|
||||
@ -53,7 +54,7 @@ struct spVertexAttachment {
|
||||
int id;
|
||||
};
|
||||
|
||||
void spVertexAttachment_computeWorldVertices (spVertexAttachment* self, spSlot* slot, int start, int count, float* worldVertices, int offset, int stride);
|
||||
SP_API void spVertexAttachment_computeWorldVertices (spVertexAttachment* self, spSlot* slot, int start, int count, float* worldVertices, int offset, int stride);
|
||||
|
||||
#ifdef SPINE_SHORT_NAMES
|
||||
typedef spVertexAttachment VertexAttachment;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_VERTEXEFFECT_H_
|
||||
#define SPINE_VERTEXEFFECT_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Skeleton.h>
|
||||
#include <spine/Color.h>
|
||||
|
||||
@ -69,13 +70,13 @@ typedef struct spSwirlVertexEffect {
|
||||
float worldY;
|
||||
} spSwirlVertexEffect;
|
||||
|
||||
spJitterVertexEffect *spJitterVertexEffect_create(float jitterX, float jitterY);
|
||||
SP_API spJitterVertexEffect *spJitterVertexEffect_create(float jitterX, float jitterY);
|
||||
|
||||
void spJitterVertexEffect_dispose(spJitterVertexEffect *effect);
|
||||
SP_API void spJitterVertexEffect_dispose(spJitterVertexEffect *effect);
|
||||
|
||||
spSwirlVertexEffect *spSwirlVertexEffect_create(float radius);
|
||||
SP_API spSwirlVertexEffect *spSwirlVertexEffect_create(float radius);
|
||||
|
||||
void spSwirlVertexEffect_dispose(spSwirlVertexEffect *effect);
|
||||
SP_API void spSwirlVertexEffect_dispose(spSwirlVertexEffect *effect);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
48
spine-c/spine-c/include/spine/dll.h
Normal file
48
spine-c/spine-c/include/spine/dll.h
Normal file
@ -0,0 +1,48 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License v2.5
|
||||
*
|
||||
* Copyright (c) 2013-2016, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable, and
|
||||
* non-transferable license to use, install, execute, and perform the Spine
|
||||
* Runtimes software and derivative works solely for personal or internal
|
||||
* use. Without the written permission of Esoteric Software (see Section 2 of
|
||||
* the Spine Software License Agreement), you may not (a) modify, translate,
|
||||
* adapt, or develop new applications using the Spine Runtimes or otherwise
|
||||
* create derivative works or improvements of the Spine Runtimes or (b) remove,
|
||||
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
|
||||
* or other intellectual property or proprietary rights notices on or in the
|
||||
* Software, including any copy thereof. Redistributions in binary or source
|
||||
* form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
|
||||
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_SHAREDLIB_H
|
||||
#define SPINE_SHAREDLIB_H
|
||||
|
||||
#define SP_API
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DLLIMPORT __declspec(dllimport)
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLLIMPORT
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
|
||||
#ifdef SPINEPLUGIN_API
|
||||
#define SP_API SPINEPLUGIN_API
|
||||
#endif
|
||||
|
||||
#endif /* SPINE_SHAREDLIB_H */
|
||||
@ -31,6 +31,7 @@
|
||||
#ifndef SPINE_SPINE_H_
|
||||
#define SPINE_SPINE_H_
|
||||
|
||||
#include <spine/dll.h>
|
||||
#include <spine/Animation.h>
|
||||
#include <spine/AnimationState.h>
|
||||
#include <spine/AnimationStateData.h>
|
||||
|
||||
Binary file not shown.
@ -11,6 +11,7 @@
|
||||
|
||||
class FRuntimeMeshVertexFactory;
|
||||
|
||||
#pragma warning( disable : 4265 )
|
||||
|
||||
template<typename T>
|
||||
struct FRuntimeMeshVertexTraits
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
#include "SpinePluginPrivatePCH.h"
|
||||
|
||||
USpineBoneDriverComponent::USpineBoneDriverComponent () {
|
||||
bWantsBeginPlay = true;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
bTickInEditor = true;
|
||||
bAutoActivate = true;
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
#include "SpinePluginPrivatePCH.h"
|
||||
|
||||
USpineBoneFollowerComponent::USpineBoneFollowerComponent () {
|
||||
bWantsBeginPlay = true;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
bTickInEditor = true;
|
||||
bAutoActivate = true;
|
||||
|
||||
@ -73,7 +73,6 @@ void callback(spAnimationState* state, spEventType type, spTrackEntry* entry, sp
|
||||
}
|
||||
|
||||
USpineSkeletonAnimationComponent::USpineSkeletonAnimationComponent () {
|
||||
bWantsBeginPlay = true;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
bTickInEditor = true;
|
||||
bAutoActivate = true;
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#define LOCTEXT_NAMESPACE "Spine"
|
||||
|
||||
USpineSkeletonComponent::USpineSkeletonComponent () {
|
||||
bWantsBeginPlay = true;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
bTickInEditor = true;
|
||||
bAutoActivate = true;
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
|
||||
USpineSkeletonRendererComponent::USpineSkeletonRendererComponent (const FObjectInitializer& ObjectInitializer)
|
||||
: URuntimeMeshComponent(ObjectInitializer) {
|
||||
bWantsBeginPlay = true;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
bTickInEditor = true;
|
||||
bAutoActivate = true;
|
||||
|
||||
@ -14,16 +14,25 @@
|
||||
"CanContainContent" : true,
|
||||
"IsBetaVersion" : false,
|
||||
"Installed" : false,
|
||||
"Modules" :
|
||||
[
|
||||
{
|
||||
"Name" : "SpinePlugin",
|
||||
"Type" : "Runtime",
|
||||
"LoadingPhase" : "PreDefault"
|
||||
},
|
||||
{
|
||||
"Name" : "SpineEditorPlugin",
|
||||
"Type" : "Editor"
|
||||
}
|
||||
]
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "SpinePlugin",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "PreDefault"
|
||||
},
|
||||
{
|
||||
"Name": "SpineEditorPlugin",
|
||||
"Type": "Editor"
|
||||
}
|
||||
],
|
||||
"Plugins": [
|
||||
{
|
||||
"Name": "ProceduralMeshComponent",
|
||||
"Enabled": true
|
||||
},
|
||||
{
|
||||
"Name": "RuntimeMeshComponent",
|
||||
"Enabled": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
37
spine-ue4/Source/SpineUE4/MySceneComponent.cpp
Normal file
37
spine-ue4/Source/SpineUE4/MySceneComponent.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#include "SpineUE4.h"
|
||||
#include "MySceneComponent.h"
|
||||
#include "spine/spine.h"
|
||||
|
||||
|
||||
// Sets default values for this component's properties
|
||||
UMySceneComponent::UMySceneComponent(const FObjectInitializer& ObjectInitializer) : USpineSkeletonRendererComponent(ObjectInitializer)
|
||||
{
|
||||
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
|
||||
// off to improve performance if you don't need them.
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
|
||||
// ...
|
||||
spColor_create();
|
||||
}
|
||||
|
||||
|
||||
// Called when the game starts
|
||||
void UMySceneComponent::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
// ...
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Called every frame
|
||||
void UMySceneComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
30
spine-ue4/Source/SpineUE4/MySceneComponent.h
Normal file
30
spine-ue4/Source/SpineUE4/MySceneComponent.h
Normal file
@ -0,0 +1,30 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/SceneComponent.h"
|
||||
#include "SpineSkeletonRendererComponent.h"
|
||||
#include "MySceneComponent.generated.h"
|
||||
|
||||
|
||||
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
||||
class SPINEUE4_API UMySceneComponent : public USpineSkeletonRendererComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this component's properties
|
||||
UMySceneComponent(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
|
||||
|
||||
};
|
||||
@ -6,7 +6,7 @@ public class SpineUE4 : ModuleRules
|
||||
{
|
||||
public SpineUE4(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "SpinePlugin" });
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "SpinePlugin", "RuntimeMeshComponent" });
|
||||
PublicIncludePaths.AddRange(new string[] { "SpinePlugin/Public", "SpinePlugin/Classes" });
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user