mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
Merge branch 'master' of github.com:fabiangreffrath/woof
This commit is contained in:
commit
0f996cb2eb
@ -714,6 +714,17 @@ static unsigned int disk_to_draw, disk_to_restore;
|
|||||||
static void CreateUpscaledTexture(boolean force);
|
static void CreateUpscaledTexture(boolean force);
|
||||||
static void I_ResetTargetRefresh(void);
|
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)
|
void I_FinishUpdate(void)
|
||||||
{
|
{
|
||||||
if (noblit)
|
if (noblit)
|
||||||
@ -787,6 +798,8 @@ void I_FinishUpdate(void)
|
|||||||
uint64_t elapsed_time = current_time - frametime_start;
|
uint64_t elapsed_time = current_time - frametime_start;
|
||||||
uint64_t remaining_time = 0;
|
uint64_t remaining_time = 0;
|
||||||
|
|
||||||
|
I_CpuPause();
|
||||||
|
|
||||||
if (elapsed_time >= target_time)
|
if (elapsed_time >= target_time)
|
||||||
{
|
{
|
||||||
frametime_start = current_time;
|
frametime_start = current_time;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user