diff options
| author | flashback-fx <[email protected]> | 2022-06-05 11:14:26 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-06-05 11:14:26 +0200 |
| commit | cda89ebb58767271f7194fcfa6855ac6b7442ec7 (patch) | |
| tree | c87d412d5bbbf7ada82747caa5c4bd61be212127 /src | |
| parent | 6fccfc57a4efdbb1f507d5a69c820b1b9f5f13c7 (diff) | |
| download | raylib-cda89ebb58767271f7194fcfa6855ac6b7442ec7.tar.gz raylib-cda89ebb58767271f7194fcfa6855ac6b7442ec7.zip | |
Fix regression that was causing video stuttering (#2503)
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rcore.c b/src/rcore.c index dbcf670b..85954e60 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -4834,6 +4834,7 @@ void WaitTime(float ms) while ((currentTime - previousTime) < ms/1000.0f) currentTime = GetTime(); #else #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) + double destTime = GetTime() + ms/1000.0f; double busyWait = ms*0.05; // NOTE: We are using a busy wait of 5% of the time ms -= (float)busyWait; #endif @@ -4857,11 +4858,7 @@ void WaitTime(float ms) #endif #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) - double previousTime = GetTime(); - double currentTime = 0.0; - - // Partial busy wait loop (only a fraction of the total wait time) - while ((currentTime - previousTime) < (busyWait/1000.0f)) currentTime = GetTime(); + while (GetTime() < destTime) { } #endif #endif } |
