mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[c] AnimationState#apply returns boolean indicating if any timeline was applied. #919
This commit is contained in:
parent
b14b5d805d
commit
061d0d26b2
@ -120,7 +120,7 @@ spAnimationState* spAnimationState_create (spAnimationStateData* data);
|
||||
void spAnimationState_dispose (spAnimationState* self);
|
||||
|
||||
void spAnimationState_update (spAnimationState* self, float delta);
|
||||
void spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);
|
||||
int /**bool**/ spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);
|
||||
|
||||
void spAnimationState_clearTracks (spAnimationState* self);
|
||||
void spAnimationState_clearTrack (spAnimationState* self, int trackIndex);
|
||||
|
||||
@ -327,7 +327,7 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
|
||||
return 0;
|
||||
}
|
||||
|
||||
void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
|
||||
int spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
|
||||
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
|
||||
spTrackEntry* current;
|
||||
int i, ii, n;
|
||||
@ -337,6 +337,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
|
||||
int /*boolean*/ firstFrame;
|
||||
float* timelinesRotation;
|
||||
spTimeline* timeline;
|
||||
int applied = 0;
|
||||
|
||||
if (internal->animationsChanged) _spAnimationState_animationsChanged(self);
|
||||
|
||||
@ -344,6 +345,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
|
||||
float mix;
|
||||
current = self->tracks[i];
|
||||
if (!current || current->delay > 0) continue;
|
||||
applied = -1;
|
||||
|
||||
/* Apply mixing from entries first. */
|
||||
mix = current->alpha;
|
||||
@ -381,6 +383,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
|
||||
}
|
||||
|
||||
_spEventQueue_drain(internal->queue);
|
||||
return applied;
|
||||
}
|
||||
|
||||
float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* to, spSkeleton* skeleton) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user