Skip to content

Commit

Permalink
[c] Added void* userData to spAnimationState to be consumed in callba…
Browse files Browse the repository at this point in the history
…cks. Closes

#1017.
  • Loading branch information
badlogic committed Oct 12, 2017
1 parent dc16e55 commit 1410867
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -52,6 +52,7 @@
* Added `spVertexEffect` and corresponding implementations `spJitterVertexEffect` and `spSwirlVertexEffect`. Create/dispose through the corresponding `spXXXVertexEffect_create()/dispose()` functions. Set on framework/engine specific renderer. See changes for spine-c based frameworks/engines below.
* Functions in `extension.h` are not prefixed with `_sp` instead of just `_` to avoid interference with other libraries.
* Introduced `SP_API` macro. Every spine-c function is prefixed with this macro. By default, it is an empty string. Can be used to markup spine-c functions with e.g. ``__declspec` when compiling to a dll or linking to that dll.
* Added `void* userData` to `spAnimationState` to be consumed in callbacks.

### Cocos2d-X
* Fixed renderer to work with 3.6 changes
Expand Down
7 changes: 5 additions & 2 deletions spine-c/spine-c/include/spine/AnimationState.h
Expand Up @@ -84,7 +84,8 @@ struct spTrackEntry {
timelineData(0),
timelineDipMix(0),
timelinesRotation(0),
timelinesRotationCount(0) {
timelinesRotationCount(0),
rendererObject(0), userData(0) {
}
#endif
};
Expand All @@ -102,6 +103,7 @@ struct spAnimationState {
spTrackEntryArray* mixingTo;

void* rendererObject;
void* userData;

#ifdef __cplusplus
spAnimationState() :
Expand All @@ -111,7 +113,8 @@ struct spAnimationState {
listener(0),
timeScale(0),
mixingTo(0),
rendererObject(0) {
rendererObject(0),
userData(0) {
}
#endif
};
Expand Down

0 comments on commit 1410867

Please sign in to comment.