From 04ad3c7cc63ae0287dac17dcb2e6361841752beb Mon Sep 17 00:00:00 2001 From: flashbackfx Date: Tue, 7 Jun 2022 20:54:38 +0200 Subject: [PATCH] Inline busy waiting code instead of using static function --- src/rcore.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index eb8fbae42..e95b3015c 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -686,10 +686,6 @@ static void RecordAutomationEvent(unsigned int frame); // Record frame even static void PlayAutomationEvent(unsigned int frame); // Play frame events (from internal events array) #endif -#if defined(SUPPORT_BUSY_WAIT_LOOP) || defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) -static void BusyWaitUntil(double destinationTime); -#endif - #if defined(_WIN32) // NOTE: We declare Sleep() function symbol to avoid including windows.h (kernel32.lib linkage required) void __stdcall Sleep(unsigned long msTimeout); // Required for: WaitTime() @@ -4835,7 +4831,7 @@ void WaitTime(double seconds) #endif #if defined(SUPPORT_BUSY_WAIT_LOOP) - BusyWaitUntil(destinationTime); + while (GetTime() < destinationTime) { } #else #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) double sleepSeconds = seconds - seconds*0.05; // NOTE: We reserve a percentage of the time for busy waiting @@ -4862,18 +4858,11 @@ void WaitTime(double seconds) #endif #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) - BusyWaitUntil(destinationTime); + while (GetTime() < destinationTime) { } #endif #endif } -#if defined(SUPPORT_BUSY_WAIT_LOOP) || defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) -static void BusyWaitUntil(double destinationTime) -{ - while (GetTime() < destinationTime) { } -} -#endif - // Swap back buffer with front buffer (screen drawing) void SwapScreenBuffer(void) {