Add linear interpolation of rendered entities

I've added a function Graphics::lerp() which simply interpolates between
two values given a certain alpha value. It's just like drawing a
straight line between two points.

Also, Graphics now has an `alpha` attribute, and it is set on every
deltatime update to be used in linear interpolation.
This commit is contained in:
Misa
2020-04-28 16:02:55 -07:00
committed by Ethan Lee
parent fd44098f38
commit 4f4d400ce0
3 changed files with 42 additions and 30 deletions

View File

@@ -543,6 +543,7 @@ int main(int argc, char *argv[])
game.gameclock();
}
const float alpha = static_cast<float>(accumulator) / timesteplimit;
graphics.alpha = alpha;
if (game.infocus)
{