25 {
26
27 fl::u32 effectiveTime = now;
28
29
30 fl::u64 microseconds = static_cast<fl::u64>(effectiveTime) * 1000ULL;
31
32
34 *nextFrameNumber = *frameNumber + 1;
35
36
37 if (amountOfNextFrame != nullptr) {
40 fl::u32 rel_time = microseconds - frame1_start;
41 fl::u32 frame_duration = frame2_start - frame1_start;
42 uint8_t progress = uint8_t(
linear_map(rel_time, 0, frame_duration, 0, 255));
43 *amountOfNextFrame = progress;
44 }
45}
fl::u32 mMicrosSecondsPerInterval
long linear_map(long x, long in_min, long in_max, long out_min, long out_max)