mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 11:16:42 +01:00
very slightly improve frame timings when not quite reaching 60 fps
This commit is contained in:
@@ -223,7 +223,9 @@ impl State {
|
|||||||
let time = (now - instance.start_time).as_millis() as i32;
|
let time = (now - instance.start_time).as_millis() as i32;
|
||||||
{
|
{
|
||||||
let offset = ((time as u32 as i64 * 6) % 100 - 50) / 6;
|
let offset = ((time as u32 as i64 * 6) % 100 - 50) / 6;
|
||||||
result = Ok(now + Duration::from_millis((16 - offset) as u64));
|
let max = now + Duration::from_millis(17);
|
||||||
|
let next_center = now + Duration::from_millis((16 - offset) as u64);
|
||||||
|
result = Ok(next_center.min(max));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user