mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[cpp] Added TrackEntry::getAnimationState(), wired up when TrackEntry is obtained from pool in AnimatinState::newTrackEntry
This commit is contained in:
parent
0e5de94529
commit
fe5e25c3a0
@ -326,6 +326,15 @@ namespace spine {
|
|||||||
return _next != NULL && _nextTrackLast - _next->_delay >= 0;
|
return _next != NULL && _nextTrackLast - _next->_delay >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The AnimationState this track entry belongs to. May be NULL if TrackEntry is directly instantiated.
|
||||||
|
AnimationState *getAnimationState() {
|
||||||
|
return _state;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setAnimationState(AnimationState *state) {
|
||||||
|
_state = state;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Animation *_animation;
|
Animation *_animation;
|
||||||
TrackEntry *_previous;
|
TrackEntry *_previous;
|
||||||
@ -345,6 +354,7 @@ namespace spine {
|
|||||||
Array<float> _timelinesRotation;
|
Array<float> _timelinesRotation;
|
||||||
AnimationStateListener _listener;
|
AnimationStateListener _listener;
|
||||||
AnimationStateListenerObject *_listenerObject;
|
AnimationStateListenerObject *_listenerObject;
|
||||||
|
AnimationState *_state;
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -58,7 +58,7 @@ TrackEntry::TrackEntry()
|
|||||||
_reverse(false), _shortestRotation(false), _eventThreshold(0), _mixAttachmentThreshold(0), _alphaAttachmentThreshold(0),
|
_reverse(false), _shortestRotation(false), _eventThreshold(0), _mixAttachmentThreshold(0), _alphaAttachmentThreshold(0),
|
||||||
_mixDrawOrderThreshold(0), _animationStart(0), _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
|
_mixDrawOrderThreshold(0), _animationStart(0), _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
|
||||||
_trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), _mixDuration(0), _interruptAlpha(0), _totalAlpha(0),
|
_trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), _mixDuration(0), _interruptAlpha(0), _totalAlpha(0),
|
||||||
_mixBlend(MixBlend_Replace), _listener(dummyOnAnimationEventFunc), _listenerObject(NULL) {
|
_mixBlend(MixBlend_Replace), _listener(dummyOnAnimationEventFunc), _listenerObject(NULL), _state(NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackEntry::~TrackEntry() {
|
TrackEntry::~TrackEntry() {
|
||||||
@ -1074,6 +1074,7 @@ TrackEntry *AnimationState::expandToIndex(size_t index) {
|
|||||||
TrackEntry *AnimationState::newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last) {
|
TrackEntry *AnimationState::newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last) {
|
||||||
TrackEntry *entryP = _trackEntryPool.obtain();// Pooling
|
TrackEntry *entryP = _trackEntryPool.obtain();// Pooling
|
||||||
TrackEntry &entry = *entryP;
|
TrackEntry &entry = *entryP;
|
||||||
|
entry.setAnimationState(this);
|
||||||
|
|
||||||
entry._trackIndex = (int) trackIndex;
|
entry._trackIndex = (int) trackIndex;
|
||||||
entry._animation = animation;
|
entry._animation = animation;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user