diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-11-08 12:26:43 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-11-08 12:26:43 +0100 |
commit | cdd75000effac0216588766234cfa5b3e8e304d5 (patch) | |
tree | 3832063bf12dae9e8b29c9e787d08dc75a9ba704 /src/interface.cpp | |
parent | c5a621b3ebeb180d2181df35038ed856714b64e2 (diff) |
Frametime-independent dynamics.
Diffstat (limited to 'src/interface.cpp')
-rw-r--r-- | src/interface.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; |