MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / processAnimation

Method processAnimation

Source/engine/animationinfo.cpp:202–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void AnimationInfo::processAnimation(bool reverseAnimation /*= false*/)
203{
204 tickCounterOfCurrentFrame++;
205 ticksSinceSequenceStarted_ += baseValueFraction;
206 if (tickCounterOfCurrentFrame >= ticksPerFrame) {
207 tickCounterOfCurrentFrame = 0;
208 if (reverseAnimation) {
209 --currentFrame;
210 if (currentFrame == -1) {
211 currentFrame = numberOfFrames - 1;
212 ticksSinceSequenceStarted_ = 0;
213 }
214 } else {
215 ++currentFrame;
216 if (currentFrame >= numberOfFrames) {
217 currentFrame = 0;
218 ticksSinceSequenceStarted_ = 0;
219 }
220 }
221 }
222}
223
224uint8_t AnimationInfo::getProgressToNextGameTick() const
225{

Callers 4

RunAnimationTestFunction · 0.80
ProcessMonstersFunction · 0.80
ProcessPlayersFunction · 0.80
ProcessItemsFunction · 0.80

Calls

no outgoing calls

Tested by 1

RunAnimationTestFunction · 0.64