Reviewed latest PR, variable name

This commit is contained in:
Ray 2022-06-06 20:23:14 +02:00
parent c11d30bafe
commit 461cdda71e
2 changed files with 6 additions and 6 deletions

View file

@ -958,7 +958,7 @@ RLAPI void DisableEventWaiting(void); // Disable wai
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
RLAPI void PollInputEvents(void); // Register all input events RLAPI void PollInputEvents(void); // Register all input events
RLAPI void WaitTime(double waitSeconds); // Wait for some time (halt program execution) RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution)
// Cursor-related functions // Cursor-related functions
RLAPI void ShowCursor(void); // Shows cursor RLAPI void ShowCursor(void); // Shows cursor

View file

@ -4824,20 +4824,20 @@ static void InitTimer(void)
// take longer than expected... for that reason we use the busy wait loop // take longer than expected... for that reason we use the busy wait loop
// Ref: http://stackoverflow.com/questions/43057578/c-programming-win32-games-sleep-taking-longer-than-expected // Ref: http://stackoverflow.com/questions/43057578/c-programming-win32-games-sleep-taking-longer-than-expected
// Ref: http://www.geisswerks.com/ryan/FAQS/timing.html --> All about timming on Win32! // Ref: http://www.geisswerks.com/ryan/FAQS/timing.html --> All about timming on Win32!
void WaitTime(double waitSeconds) void WaitTime(double seconds)
{ {
#if defined(SUPPORT_BUSY_WAIT_LOOP) #if defined(SUPPORT_BUSY_WAIT_LOOP)
double previousTime = GetTime(); double previousTime = GetTime();
double currentTime = 0.0; double currentTime = 0.0;
// Busy wait loop // Busy wait loop
while ((currentTime - previousTime) < waitSeconds) currentTime = GetTime(); while ((currentTime - previousTime) < seconds) currentTime = GetTime();
#else #else
#if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP)
double destinationTime = GetTime() + waitSeconds; double destinationTime = GetTime() + seconds;
double sleepSeconds = waitSeconds - waitSeconds*0.05; // NOTE: We reserve a percentage of the time for busy waiting double sleepSeconds = seconds - seconds*0.05; // NOTE: We reserve a percentage of the time for busy waiting
#else #else
double sleepSeconds = waitSeconds; double sleepSeconds = seconds;
#endif #endif
// System halt functions // System halt functions