Skip to content
Snippets Groups Projects
Commit fbfecdfb authored by Lava Block's avatar Lava Block
Browse files

rename to_dt -> to_delta

parent 99e62eed
No related branches found
No related tags found
No related merge requests found
......@@ -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;
});
}
......
......@@ -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.)); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment