From 400c75a69c775376fc6fcdfa0e97d2a0169d7622 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 11 Aug 2012 10:10:59 +0000 Subject: [PATCH] core: clamp deltatime to 15 fps to avoid erratic behaviour. --- src/ticker.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ticker.cpp b/src/ticker.cpp index fb114f63..79351c12 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -193,6 +193,13 @@ void *TickerData::GameThreadMain(void * /* p */) data->bias += data->deltatime; } + /* Do not go below 15 fps */ + if (data->deltatime > 1.f / 15.f) + { + data->deltatime = 1.f / 15.f; + data->bias = 0.f; + } + /* If shutdown is stuck, kick the first entity we meet and see * whether it makes things better. Note that it is always a bug to * have referenced entities after 20 frames, but at least this