mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
let the CPU sleep for 1 ms if there is no tic to proceed
This brings CPU usage down from 100% to ~18% on my system - just like Chocolate Doom.
This commit is contained in:
parent
7af1150cb1
commit
15131a1cc2
@ -758,6 +758,7 @@ void TryRunTics (void)
|
||||
M_Ticker ();
|
||||
return;
|
||||
}
|
||||
I_Sleep(1);
|
||||
}
|
||||
|
||||
// run the count * ticdup dics
|
||||
|
@ -59,6 +59,11 @@ void I_WaitVBL(int count)
|
||||
SDL_Delay((count*500)/TICRATE);
|
||||
}
|
||||
|
||||
void I_Sleep(int ms)
|
||||
{
|
||||
SDL_Delay(ms);
|
||||
}
|
||||
|
||||
// Most of the following has been rewritten by Lee Killough
|
||||
//
|
||||
// I_GetTime
|
||||
|
@ -47,6 +47,7 @@ void I_FinishUpdate (void);
|
||||
|
||||
// Wait for vertical retrace or pause a bit.
|
||||
void I_WaitVBL(int count);
|
||||
void I_Sleep(int ms);
|
||||
|
||||
void I_ReadScreen (byte* scr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user