Skip to content

Commit

Permalink
Update animationinfo.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Nairdaa authored Nov 19, 2024
1 parent 23de19e commit 8243b1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/engine/animationinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ int8_t AnimationInfo::getFrameToUseForRendering() const
// Handle edge case where the calculated frame exceeds limits.
if (absoluteAnimationFrame >= (relevantFramesForDistributing_ + 1))
{
Log("getFrameToUseForRendering: Invalid Animation Frame (Calculated {} MaxFrame {})", absoluteAnimationFrame, relevantFramesForDistributing_);
Log("getFrameToUseForRendering: Invalid Animation Frame (Calculated {} MaxFrame {})",
absoluteAnimationFrame, relevantFramesForDistributing_);
}

return relevantFramesForDistributing_ - 1;
Expand Down Expand Up @@ -97,7 +98,7 @@ uint8_t AnimationInfo::getAnimationProgress() const
return static_cast<uint8_t>(animationFraction);
}

void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numberOfFrames, int8_t ticksPerFrame, AnimationDistributionFlags flags /*= AnimationDistributionFlags::None*/, int8_t numSkippedFrames /*= 0*/, int8_t distributeFramesBeforeFrame /*= 0*/, uint8_t previewShownGameTickFragments /*= 0*/)
void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numberOfFrames, int8_t ticksPerFrame, AnimationDistributionFlags flags /*= AnimationDistributionFlags::None*/, int8_t numSkippedFrames /*= 0*/, int8_t distributeFramesBeforeFrame /*= 0*/, uint8_t previewShownGameTickFragments /*= 0*/)
{
if ((flags & AnimationDistributionFlags::RepeatedAction) == AnimationDistributionFlags::RepeatedAction && distributeFramesBeforeFrame != 0 && this->numberOfFrames == numberOfFrames && currentFrame + 1 >= distributeFramesBeforeFrame && currentFrame != this->numberOfFrames - 1)
{
Expand Down Expand Up @@ -134,7 +135,7 @@ void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numb
}
}

void AnimationInfo::configureFrameDistribution(AnimationDistributionFlags flags, int8_t numberOfFrames, int8_t distributeFramesBeforeFrame, int8_t numSkippedFrames, int8_t ticksPerFrame, uint8_t previewShownGameTickFragments)
void AnimationInfo::configureFrameDistribution(AnimationDistributionFlags flags, int8_t numberOfFrames, int8_t distributeFramesBeforeFrame, int8_t numSkippedFrames, int8_t ticksPerFrame, uint8_t previewShownGameTickFragments)
{
int8_t relevantAnimationFramesForDistributing = numberOfFrames;

Expand Down Expand Up @@ -214,8 +215,7 @@ void AnimationInfo::processAnimation(bool reverseAnimation /*= false*/)
if (reverseAnimation)
{
--currentFrame;
if (currentFrame < 0)
{
if (currentFrame < 0) {
currentFrame = numberOfFrames - 1;
ticksSinceSequenceStarted_ = 0;
}
Expand Down

0 comments on commit 8243b1f

Please sign in to comment.