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:
Yamagi Burmeister 2018-09-30 18:42:21 +02:00
parent 95bbb9900b
commit 70ee5bcc4a

View file

@ -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
@ -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;
} }