|
|
|
|
@ -75,7 +75,7 @@ float AnimationInfo::GetAnimationProgress() const
|
|
|
|
|
return animationFraction; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AnimationInfo::SetNewAnimation(const CelSprite *celSprite, int numberOfFrames, int ticksPerFrame, AnimationDistributionFlags flags /*= AnimationDistributionFlags::None*/, int numSkippedFrames /*= 0*/, int distributeFramesBeforeFrame /*= 0*/) |
|
|
|
|
void AnimationInfo::SetNewAnimation(const CelSprite *celSprite, int numberOfFrames, int ticksPerFrame, AnimationDistributionFlags flags /*= AnimationDistributionFlags::None*/, int numSkippedFrames /*= 0*/, int distributeFramesBeforeFrame /*= 0*/, float previewShownGameTickFragments /*= 0.F*/) |
|
|
|
|
{ |
|
|
|
|
if ((flags & AnimationDistributionFlags::RepeatedAction) == AnimationDistributionFlags::RepeatedAction && distributeFramesBeforeFrame != 0 && NumberOfFrames == numberOfFrames && CurrentFrame >= distributeFramesBeforeFrame && CurrentFrame != NumberOfFrames) { |
|
|
|
|
// We showed the same Animation (for example a melee attack) before but truncated the Animation.
|
|
|
|
|
@ -129,6 +129,11 @@ void AnimationInfo::SetNewAnimation(const CelSprite *celSprite, int numberOfFram
|
|
|
|
|
TicksSinceSequenceStarted = -1.F; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The preview animation was shown some times (less then one game tick)
|
|
|
|
|
// So we overall have a longer time the animation is shown
|
|
|
|
|
TicksSinceSequenceStarted += previewShownGameTickFragments; |
|
|
|
|
relevantAnimationTicksWithSkipping += previewShownGameTickFragments; |
|
|
|
|
|
|
|
|
|
if ((flags & AnimationDistributionFlags::SkipsDelayOfLastFrame) == AnimationDistributionFlags::SkipsDelayOfLastFrame) { |
|
|
|
|
// The logic for player/monster/... (not ProcessAnimation) only checks the frame not the delay.
|
|
|
|
|
// That means if a delay is specified, the last-frame is shown less than the other frames
|
|
|
|
|
|