From 961a93719c7a2849d6add582a1265665b19cf4f3 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Tue, 8 Oct 2013 12:05:55 +0200 Subject: [PATCH] set/addAnimation doesn't allow null animation. --- spine-c/src/spine/AnimationState.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-c/src/spine/AnimationState.c b/spine-c/src/spine/AnimationState.c index 29de4dc20..d3fad3901 100644 --- a/spine-c/src/spine/AnimationState.c +++ b/spine-c/src/spine/AnimationState.c @@ -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) {