MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / update

Method update

src/Core/Animation/Animator.cpp:156–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 12

getAllAnimationNameMethod · 0.95
applyTextureMethod · 0.95
NoSelectedAnimationClass · 0.85
UnknownAnimationClass · 0.85
traceMethod · 0.80
getCalledAnimationMethod · 0.80
toStringMethod · 0.45
getStatusMethod · 0.45
resetMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected