mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
check if gfx_refresh_rate is non zero
This commit is contained in:
parent
6f0509cfae
commit
3458ee0976
|
@ -2803,7 +2803,7 @@ void CClient::Run()
|
||||||
m_FpsGraph.Add(1.0f/m_RenderFrameTime, 1,1,1);
|
m_FpsGraph.Add(1.0f/m_RenderFrameTime, 1,1,1);
|
||||||
|
|
||||||
// keep the overflow time - it's used to make sure the gfx refreshrate is reached
|
// keep the overflow time - it's used to make sure the gfx refreshrate is reached
|
||||||
int64 AdditionalTime = (Now - LastRenderTime) - (int64)((float)time_freq() / (float)g_Config.m_GfxRefreshRate);
|
int64 AdditionalTime = g_Config.m_GfxRefreshRate ? ((Now - LastRenderTime) - (int64)((float)time_freq() / (float)g_Config.m_GfxRefreshRate)) : 0;
|
||||||
// if the value is over a second time loose, reset the additional time (drop the frames we lost already)
|
// if the value is over a second time loose, reset the additional time (drop the frames we lost already)
|
||||||
if(AdditionalTime > time_freq())
|
if(AdditionalTime > time_freq())
|
||||||
AdditionalTime = time_freq();
|
AdditionalTime = time_freq();
|
||||||
|
|
Loading…
Reference in a new issue