Merge branch 'master' of github.com:fabiangreffrath/woof

This commit is contained in:
Fabian Greffrath 2024-06-04 17:58:28 +02:00
commit 0f996cb2eb

View File

@ -714,6 +714,17 @@ static unsigned int disk_to_draw, disk_to_restore;
static void CreateUpscaledTexture(boolean force);
static void I_ResetTargetRefresh(void);
//
// I_CpuPause
// Avoids a performance penalty on exit from busy-wait loops. This should be
// called on every iteration of the loop and positioned near the loop exit.
//
#if SDL_VERSION_ATLEAST(2, 24, 0)
#define I_CpuPause() SDL_CPUPauseInstruction()
#else
#define I_CpuPause()
#endif
void I_FinishUpdate(void)
{
if (noblit)
@ -787,6 +798,8 @@ void I_FinishUpdate(void)
uint64_t elapsed_time = current_time - frametime_start;
uint64_t remaining_time = 0;
I_CpuPause();
if (elapsed_time >= target_time)
{
frametime_start = current_time;