1
0
mirror of https://github.com/DragonMinded/jubeatmenu.git synced 2024-11-14 18:27:35 +01:00
jubeatmenu/JubeatMenu/Animation.h
Jennifer Taylor c6fa4d43b1 Clean up a few things.
Allow multiple inputs to be queued for scrolling.
Fix freezing animations if clock goes backwards.
Refactor display Tick() to be less messy.
2019-07-02 22:56:22 -07:00

31 lines
624 B
C++

#pragma once
#define SPEED_REDUCE_PERCENTAGE 0.6
#define SPEED_REDUCE_LOCATION 0.5
#define MAX_SPEED_CHANGES 8
class Animation
{
public:
Animation();
~Animation();
void Animate(int animationOffset, int animationDistance, double pixelsPerSecond, bool allowDeceleration);
void CancelDeceleration();
bool IsAnimating();
void Tick();
int Position();
private:
LONG CurrentMilliseconds();
bool isAnimating;
int distance;
double location;
double speedChangeLocation;
int speedChanges;
int offset;
double speed;
double originalSpeed;
LONG lastMilliseconds;
};