From 33cd49d931551127337f0720e17ad3a778888b49 Mon Sep 17 00:00:00 2001 From: polsevev Date: Mon, 27 Feb 2023 03:27:17 +0100 Subject: [PATCH] added a limit to how much skipping can be done to avoid low fps --- src/GuiHookVec.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GuiHookVec.rs b/src/GuiHookVec.rs index 6760fe3..681fb31 100644 --- a/src/GuiHookVec.rs +++ b/src/GuiHookVec.rs @@ -106,7 +106,11 @@ impl GuiVec{ (Ok(a), false) => a, (Err(_), _)=> {f32::MAX} }; - + if get_fps() < 50{ + + self.renderSkip /= 2; + + } next_frame().await; self.skipped = 0; }else{ @@ -116,6 +120,8 @@ impl GuiVec{ if frames >= self.delay && !self.done{ break; } + + frames += get_frame_time()* 1000.; }