From 14108679bb78487b2986cb9337c446be62c0c41b Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 12 Oct 2017 14:36:58 +0200 Subject: [PATCH] [c] Added void* userData to spAnimationState to be consumed in callbacks. Closes #1017. --- CHANGELOG.md | 1 + spine-c/spine-c/include/spine/AnimationState.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b4f35c3..c7341923f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/spine-c/spine-c/include/spine/AnimationState.h b/spine-c/spine-c/include/spine/AnimationState.h index fe6ae515a..224581961 100644 --- a/spine-c/spine-c/include/spine/AnimationState.h +++ b/spine-c/spine-c/include/spine/AnimationState.h @@ -84,7 +84,8 @@ struct spTrackEntry { timelineData(0), timelineDipMix(0), timelinesRotation(0), - timelinesRotationCount(0) { + timelinesRotationCount(0), + rendererObject(0), userData(0) { } #endif }; @@ -102,6 +103,7 @@ struct spAnimationState { spTrackEntryArray* mixingTo; void* rendererObject; + void* userData; #ifdef __cplusplus spAnimationState() : @@ -111,7 +113,8 @@ struct spAnimationState { listener(0), timeScale(0), mixingTo(0), - rendererObject(0) { + rendererObject(0), + userData(0) { } #endif };