Browse Source

GetOffsetForWalking: use uint8_t for animation fraction

pull/5480/head
obligaron 3 years ago committed by Gleb Mazovetskiy
parent
commit
dc3d797269
  1. 2
      Source/engine/render/scrollrt.cpp

2
Source/engine/render/scrollrt.cpp

@ -1278,7 +1278,7 @@ Displacement GetOffsetForWalking(const AnimationInfo &animationInfo, const Direc
constexpr Displacement MovingOffset[8] = { { 0, 32 }, { -32, 16 }, { -64, 0 }, { -32, -16 }, { 0, -32 }, { 32, -16 }, { 64, 0 }, { 32, 16 } };
// clang-format on
int8_t animationProgress = animationInfo.getAnimationProgress();
uint8_t animationProgress = animationInfo.getAnimationProgress();
Displacement offset = MovingOffset[static_cast<size_t>(dir)];
offset *= animationProgress;
offset /= AnimationInfo::baseValueFraction;

Loading…
Cancel
Save