diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-01 11:19:12 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-01 11:19:12 +0100 |
commit | 324683f6e9c6898783ac19795a9cb69a989bb7af (patch) | |
tree | 896e23901677dddacef0fcf02ef818e7c0d4432d /main | |
parent | ac81e02f5afe98e55d2d3d8bc0da2b7d8e084a6f (diff) |
good
Diffstat (limited to 'main')
-rw-r--r-- | main/draw.cpp | 4 | ||||
-rw-r--r-- | main/main-impl.hpp | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/main/draw.cpp b/main/draw.cpp index f039e321..76081f9b 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -87,13 +87,13 @@ void main_impl::draw_world() noexcept void main_impl::do_update() // todo! move to separate file { constexpr auto eps = 1e-5f; - const auto dt = timeline.update(); + auto dt = timeline.update(); if (auto secs = Time::to_seconds(dt); secs > eps) { #if 1 constexpr float RC = 60; constexpr auto alpha = 1 / (1 + RC); - _frame_time = _frame_time * (1 - alpha) + alpha * secs; + _smoothed_frame_time = _smoothed_frame_time * (1 - alpha) + alpha * secs; #else _frame_time = secs; #endif diff --git a/main/main-impl.hpp b/main/main-impl.hpp index 62346893..c056dfa9 100644 --- a/main/main-impl.hpp +++ b/main/main-impl.hpp @@ -104,7 +104,6 @@ struct main_impl final : Platform::Sdl2Application, floormat_main private: Time timeline; - float _frame_time = 0; struct texture_unit_cache _tuc; fm_settings s; |