summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-03 11:08:06 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-04 06:58:12 +0100
commit5da1415e7c6080c892e6f90eac74a51fa1409993 (patch)
tree7a70e095c3ae7aa1abda43a9c5268a043c368ab4 /main
parentd0065f07cdcb62f49586e2067fd164897fddba6f (diff)
main/draw: b?
Diffstat (limited to 'main')
-rw-r--r--main/draw.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/main/draw.cpp b/main/draw.cpp
index 435309a0..000d4630 100644
--- a/main/draw.cpp
+++ b/main/draw.cpp
@@ -24,19 +24,18 @@ void main_impl::do_update()
{
constexpr auto eps = 1e-5f;
auto dt = timeline.update();
- if (auto secs = Time::to_seconds(dt); secs > eps)
+ if (float secs{Time::to_seconds(dt)}; secs > eps)
{
#if 1
- constexpr double RC = 60;
- constexpr double alpha = 1 / (1 + RC);
- auto& value = _frame_timings.smoothed_frame_time;
-
- value = (float)(value*(1 - alpha) + alpha * secs);
+ constexpr float RC = 60;
+ constexpr float alpha = 1 / (1 + RC);
+ float& value = _frame_timings.smoothed_frame_time;
+ value = (value*(1 - alpha) + alpha * secs);
#else
value = secs;
#endif
if (secs > 35e-3f /* && !dt_expected.do_sleep */)
- fm_debug("%zu frame took %.2f milliseconds", bad_frame_counter++, (double)secs*1e3);
+ fm_debug("%zu frame took %.2f milliseconds", bad_frame_counter++, (double)(secs*1e3));
}
else
swapBuffers();