mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[cpp] Closes #1404, add define SPINE_USE_STD_FUNCTION. When set, the animation state callback can be a std::function.
This commit is contained in:
parent
8172d8c98b
commit
f020c2ceba
@ -37,6 +37,10 @@
|
|||||||
#include <spine/SpineString.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/HasRendererObject.h>
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
|
#ifdef SPINE_USE_STD_FUNCTION
|
||||||
|
#include <functional>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
enum EventType {
|
enum EventType {
|
||||||
EventType_Start,
|
EventType_Start,
|
||||||
@ -55,9 +59,13 @@ namespace spine {
|
|||||||
class AnimationStateData;
|
class AnimationStateData;
|
||||||
class Skeleton;
|
class Skeleton;
|
||||||
class RotateTimeline;
|
class RotateTimeline;
|
||||||
|
|
||||||
typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event);
|
|
||||||
|
|
||||||
|
#ifdef SPINE_USE_STD_FUNCTION
|
||||||
|
typedef std::function<void (AnimationState* state, EventType type, TrackEntry* entry, Event* event)> AnimationStateListener;
|
||||||
|
#else
|
||||||
|
typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event);
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Abstract class to inherit from to create a callback object
|
/// Abstract class to inherit from to create a callback object
|
||||||
class SP_API AnimationStateListenerObject {
|
class SP_API AnimationStateListenerObject {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user