Revert "Rework GLimp_GetRefreshRate(), fix a stupid bug."
After some pondering I realised that the changes was stupid. It introduces some new subtile bugs, for example in some cases SDL still rounds 59.95hz down to 59hz...
This commit is contained in:
parent
95bbb9900b
commit
70ee5bcc4a
|
@ -377,7 +377,7 @@ GLimp_GetRefreshRate(void)
|
||||||
|
|
||||||
if (vid_displayrefreshrate->value > -1)
|
if (vid_displayrefreshrate->value > -1)
|
||||||
{
|
{
|
||||||
glimp_refreshRate = floor(vid_displayrefreshrate->value);
|
glimp_refreshRate = ceil(vid_displayrefreshrate->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do this only once. We asume that no one will change their
|
/* Do this only once. We asume that no one will change their
|
||||||
|
@ -389,7 +389,7 @@ GLimp_GetRefreshRate(void)
|
||||||
|
|
||||||
int i = SDL_GetWindowDisplayIndex(window);
|
int i = SDL_GetWindowDisplayIndex(window);
|
||||||
|
|
||||||
if (i >= 0 && SDL_GetCurrentDisplayMode(i, &mode) == 0)
|
if(i >= 0 && SDL_GetCurrentDisplayMode(i, &mode) == 0)
|
||||||
{
|
{
|
||||||
glimp_refreshRate = mode.refresh_rate;
|
glimp_refreshRate = mode.refresh_rate;
|
||||||
}
|
}
|
||||||
|
@ -401,5 +401,12 @@ GLimp_GetRefreshRate(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The value reported by SDL may be one frame too low, for example
|
||||||
|
on my old Radeon R7 360 the driver returns 59hz for my 59.95hz
|
||||||
|
display. And Quake II isn't that accurate, we loose a little bit
|
||||||
|
here and there. Since it doesn't really hurt if we're running a
|
||||||
|
litte bit too fast just return one frame more than we really have. */
|
||||||
|
glimp_refreshRate++;
|
||||||
|
|
||||||
return glimp_refreshRate;
|
return glimp_refreshRate;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue