| 152 | } |
| 153 | |
| 154 | void SkeletonAnimation::setAnimationStateData(AnimationStateData *stateData) { |
| 155 | AXASSERT(stateData, "stateData cannot be null."); |
| 156 | |
| 157 | if (_ownsAnimationStateData) delete _state->getData(); |
| 158 | delete _state; |
| 159 | |
| 160 | _ownsAnimationStateData = false; |
| 161 | _state = new (__FILE__, __LINE__) AnimationState(stateData); |
| 162 | _state->setRendererObject(this); |
| 163 | _state->setListener(animationCallback); |
| 164 | } |
| 165 | |
| 166 | void SkeletonAnimation::setMix(const std::string &fromAnimation, const std::string &toAnimation, float duration) { |
| 167 | _state->getData()->setMix(fromAnimation.c_str(), toAnimation.c_str(), duration); |