mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[c] Fix for clearTracks, see #805
This commit is contained in:
parent
dc8f89fd65
commit
fe33e912c6
@ -534,12 +534,13 @@ void _spAnimationState_queueEvents (spAnimationState* self, spTrackEntry* entry,
|
||||
|
||||
void spAnimationState_clearTracks (spAnimationState* self) {
|
||||
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
|
||||
int i, n;
|
||||
int i, n, oldDrainDisabled;
|
||||
oldDrainDisabled = internal->queue->drainDisabled;
|
||||
internal->queue->drainDisabled = 1;
|
||||
for (i = 0, n = self->tracksCount; i < n; i++)
|
||||
spAnimationState_clearTrack(self, i);
|
||||
self->tracksCount = 0;
|
||||
internal->queue->drainDisabled = 0;
|
||||
internal->queue->drainDisabled = oldDrainDisabled;
|
||||
_spEventQueue_drain(internal->queue);
|
||||
}
|
||||
|
||||
@ -674,15 +675,16 @@ spTrackEntry* spAnimationState_addEmptyAnimation(spAnimationState* self, int tra
|
||||
}
|
||||
|
||||
void spAnimationState_setEmptyAnimations(spAnimationState* self, float mixDuration) {
|
||||
int i, n;
|
||||
int i, n, oldDrainDisabled;
|
||||
spTrackEntry* current;
|
||||
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
|
||||
oldDrainDisabled = internal->queue->drainDisabled;
|
||||
internal->queue->drainDisabled = 1;
|
||||
for (i = 0, n = self->tracksCount; i < n; i++) {
|
||||
current = self->tracks[i];
|
||||
if (current) spAnimationState_setEmptyAnimation(self, current->trackIndex, mixDuration);
|
||||
}
|
||||
internal->queue->drainDisabled = 0;
|
||||
internal->queue->drainDisabled = oldDrainDisabled;
|
||||
_spEventQueue_drain(internal->queue);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user