mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 00:06:42 +08:00
set/addAnimation doesn't allow null animation.
This commit is contained in:
parent
da7ef99c34
commit
961a93719c
@ -221,7 +221,7 @@ void _AnimationState_setCurrent (AnimationState* self, int index, TrackEntry* en
|
||||
}
|
||||
|
||||
TrackEntry* AnimationState_setAnimationByName (AnimationState* self, int trackIndex, const char* animationName, int/*bool*/loop) {
|
||||
Animation* animation = animationName ? SkeletonData_findAnimation(self->data->skeletonData, animationName) : 0;
|
||||
Animation* animation = SkeletonData_findAnimation(self->data->skeletonData, animationName);
|
||||
return AnimationState_setAnimation(self, trackIndex, animation, loop);
|
||||
}
|
||||
|
||||
@ -234,14 +234,14 @@ TrackEntry* AnimationState_setAnimation (AnimationState* self, int trackIndex, A
|
||||
entry->animation = animation;
|
||||
entry->loop = loop;
|
||||
entry->time = 0;
|
||||
entry->endTime = animation ? animation->duration : 0;
|
||||
entry->endTime = animation->duration;
|
||||
_AnimationState_setCurrent(self, trackIndex, entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
TrackEntry* AnimationState_addAnimationByName (AnimationState* self, int trackIndex, const char* animationName, int/*bool*/loop,
|
||||
float delay) {
|
||||
Animation* animation = animationName ? SkeletonData_findAnimation(self->data->skeletonData, animationName) : 0;
|
||||
Animation* animation = SkeletonData_findAnimation(self->data->skeletonData, animationName);
|
||||
return AnimationState_addAnimation(self, trackIndex, animation, loop, delay);
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ TrackEntry* AnimationState_addAnimation (AnimationState* self, int trackIndex, A
|
||||
entry->animation = animation;
|
||||
entry->loop = loop;
|
||||
entry->time = 0;
|
||||
entry->endTime = animation ? animation->duration : 0;
|
||||
entry->endTime = animation->duration;
|
||||
|
||||
last = _AnimationState_expandToIndex(self, trackIndex);
|
||||
if (last) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user