mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 06:44:56 +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/HasRendererObject.h>
|
||||
|
||||
#ifdef SPINE_USE_STD_FUNCTION
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
namespace spine {
|
||||
enum EventType {
|
||||
EventType_Start,
|
||||
@ -55,9 +59,13 @@ namespace spine {
|
||||
class AnimationStateData;
|
||||
class Skeleton;
|
||||
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
|
||||
class SP_API AnimationStateListenerObject {
|
||||
public:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user