From cdd75000effac0216588766234cfa5b3e8e304d5 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Wed, 8 Nov 2017 12:26:43 +0100 Subject: Frametime-independent dynamics. --- src/interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/interface.cpp') diff --git a/src/interface.cpp b/src/interface.cpp index 11e297e..3a6a294 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -15,7 +15,7 @@ static sf::Vector2f compute_pan(sf::RenderWindow *window, sf::Vector2f pan_ref) return -(vmouse - pan_ref); } -void state_t::tick(void) +void state_t::tick(double dt) { sf::Vector2u size; sf::Event event; @@ -24,7 +24,7 @@ void state_t::tick(void) size = window->getSize(); - camera.zoom = (camera.zoom + camera.target_zoom) / 2; + camera.zoom = expfade(camera.zoom, camera.target_zoom, 15, dt); { float view_scale; -- cgit