diff --git a/liblava/app/app.cpp b/liblava/app/app.cpp index e032e81ecb2db99d3c37d85b729b5218e1ea735c..dc91a6780930eccc88959f7ab2ccdab0f1fd928f 100644 --- a/liblava/app/app.cpp +++ b/liblava/app/app.cpp @@ -355,29 +355,29 @@ void app::update() { add_run([&]() { - auto delta = ms(0); + auto dt = ms(0); auto time = now(); if (run_time.system != time) { - delta = time - run_time.system; + dt = time - run_time.system; run_time.system = time; } - run_time.delta = delta; + run_time.delta = dt; if (!run_time.paused) { if (run_time.use_fix_delta) - delta = run_time.fix_delta; + dt = run_time.fix_delta; - delta = to_ms(to_sec(delta) * run_time.speed); - run_time.current += delta; + dt = to_ms(to_sec(dt) * run_time.speed); + run_time.current += dt; } else - delta = ms(0); + dt = ms(0); - return on_update ? on_update(to_dt(delta)) : true; + return on_update ? on_update(to_delta(dt)) : true; }); } diff --git a/liblava/core/time.hpp b/liblava/core/time.hpp index ff33412abe058c142abf09bef6ca4267aae2dde3..49c0017aa02cfdd49f3adef17608834d2d872b34 100644 --- a/liblava/core/time.hpp +++ b/liblava/core/time.hpp @@ -20,7 +20,7 @@ using clock = std::chrono::high_resolution_clock; using time_point = clock::time_point; using duration = clock::duration; -inline delta to_dt(milliseconds ms) { return ms.count() / 1000.f; } +inline delta to_delta(milliseconds ms) { return ms.count() / 1000.f; } inline r64 to_sec(milliseconds ms) { return ms.count() / 1000.; } inline ms to_ms(delta dt) { return ms(to_i32(dt * 1000.f)); } inline ms to_ms(r64 sec) { return ms(to_i32(sec * 1000.)); }