DT can actually be 0 :P (e.g. in server with no graphics, and I
guess on really fast computers). Bad things happen with dt=0, so set dt to at least 1 ms.
This commit is contained in:
parent
6edfc02ec5
commit
1cc9f503a4
@ -86,7 +86,11 @@ float MainLoop::getLimitedDt()
|
||||
{
|
||||
m_curr_time = device->getTimer()->getRealTime();
|
||||
dt = (float)(m_curr_time - m_prev_time);
|
||||
if (dt <= 0) break; // should not really happen
|
||||
if (dt <= 0)
|
||||
{
|
||||
dt = 1; // at least 1 ms, otherwise with dt=0 bad things happen
|
||||
break; // should not really happen
|
||||
}
|
||||
const World* const world = World::getWorld();
|
||||
if (UserConfigParams::m_fps_debug && world)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user