mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Increase delay granularity for more stable framerate
This commit is contained in:
parent
d8bef70171
commit
ebd4197f5c
1 changed files with 8 additions and 3 deletions
|
|
@ -1731,9 +1731,14 @@ boolean I_CheckFrameCap(precise_t start, precise_t end)
|
||||||
|
|
||||||
// If the wait's greater than our granularity value,
|
// If the wait's greater than our granularity value,
|
||||||
// we'll just burn the couple extra cycles in the main loop
|
// we'll just burn the couple extra cycles in the main loop
|
||||||
// in order to get to the next frame. This makes us reach just
|
// in order to get to the next frame.
|
||||||
// that much closer to exactly the FPS cap!
|
// This makes us get to the exact FPS cap more often.
|
||||||
#define DELAY_GRANULARITY 10 // 10ms is the average clock tick of most OS scheduling. (https://www.libsdl.org/release/SDL-1.2.15/docs/html/sdldelay.html)
|
|
||||||
|
// Higher values have more wasted CPU cycles, but the in-game frame performance is better.
|
||||||
|
// 10ms is the average clock tick of most OS scheduling.
|
||||||
|
// 15ms is a little more than that, for leniency on slow machines. (This helps mine reach a stable 60, at least!)
|
||||||
|
// (https://www.libsdl.org/release/SDL-1.2.15/docs/html/sdldelay.html)
|
||||||
|
#define DELAY_GRANULARITY 15
|
||||||
if (wait >= DELAY_GRANULARITY)
|
if (wait >= DELAY_GRANULARITY)
|
||||||
{
|
{
|
||||||
SDL_Delay(wait);
|
SDL_Delay(wait);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue