| 154 | } |
| 155 | |
| 156 | void Animator::update() |
| 157 | { |
| 158 | if (!m_paused) |
| 159 | { |
| 160 | Debug::Log->trace("<Animator> Updating Animator at {0}", m_path.toString()); |
| 161 | if (m_currentAnimation == nullptr) |
| 162 | throw Exceptions::NoSelectedAnimation(m_path.toString(), EXC_INFO); |
| 163 | if (m_currentAnimation->getStatus() == AnimationStatus::Call) |
| 164 | { |
| 165 | m_currentAnimation->reset(); |
| 166 | const std::string nextAnimation |
| 167 | = m_currentAnimation->getCalledAnimation(); |
| 168 | if (m_animations.find(nextAnimation) == m_animations.end()) |
| 169 | throw Exceptions::UnknownAnimation(m_path.toString(), nextAnimation, |
| 170 | this->getAllAnimationName(), EXC_INFO); |
| 171 | m_currentAnimation = m_animations[nextAnimation].get(); |
| 172 | } |
| 173 | if (m_currentAnimation->getStatus() == AnimationStatus::Play) |
| 174 | m_currentAnimation->update(); |
| 175 | |
| 176 | if (m_target) |
| 177 | { |
| 178 | this->applyTexture(); |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | void Animator::setTarget( |
| 184 | Graphics::Sprite& sprite, AnimatorTargetScaleMode targetScaleMode) |
nothing calls this directly
no test coverage detected