mirror of
https://github.com/DragonMinded/jubeatmenu.git
synced 2024-11-14 18:27:35 +01:00
c6fa4d43b1
Allow multiple inputs to be queued for scrolling. Fix freezing animations if clock goes backwards. Refactor display Tick() to be less messy.
31 lines
624 B
C++
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;
|
|
};
|