made fade_time a const instead of magic number

This commit is contained in:
Bob Polis 2020-11-16 11:21:34 +01:00
parent 124acffc01
commit 91655454f6

View File

@ -15,6 +15,7 @@
#include <algorithm>
const int default_frames_per_rect {10};
const int fade_time {5}; // seconds
enum class FadingState {
fadein,
@ -111,7 +112,7 @@ void FadingRects::update() {
rect.cur_alpha = 0.0;
rect.state = FadingState::fadein;
rect.sustain_frame = 0;
rect.delta = rect.alpha / (5 * fps());
rect.delta = rect.alpha / (fade_time * fps());
rect.line_width = random_between(1.0, 20.0);
rect.x = rr.x;
rect.y = rr.y;