-
Notifications
You must be signed in to change notification settings - Fork 5
/
Faded.h
34 lines (30 loc) · 925 Bytes
/
Faded.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "Basic.h"
class Faded {
public:
static void faded()
{
while (1)
{
float amount = 0.01; //FADE ALGORITHIM
if (fade.x > 0 && fade.z <= 0) {
fade.x -= amount;
fade.y += amount;
}
if (fade.y > 0 && fade.x <= 0) {
fade.y -= amount;
fade.z += amount;
}
if (fade.z > 0 && fade.y <= 0) {
fade.x += amount;
fade.z -= amount;
} //END OF FADE ALGORITHIM
// 1000 MS = 1 S
chrono::milliseconds delay;
int ff = settings.fade_fps;
if (ff == 0) ff = 60;
delay = chrono::milliseconds(1000 / ff);
this_thread::sleep_for(delay);
}
}
};