]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/layout.cpp
Limit timestep to 10 milliseconds
[r2c2.git] / source / libr2c2 / layout.cpp
index fe21881a2e4ab46a5f7f1e3b6a6e48c75bf7c2af..70a9f106849d26ec2f9b59ad0eb2d5b8d13a2169 100644 (file)
@@ -425,6 +425,14 @@ void Layout::tick()
                dt = t-last_tick;
        last_tick = t;
 
+       unsigned count = dt/(10*Time::msec)+1;
+       dt /= count;
+       while(count--)
+               step(dt);
+}
+
+void Layout::step(const Time::TimeDelta &dt)
+{
        if(!driver || !driver->is_halted())
                clock.tick(dt);