mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- added 100% CPU fix provided by Leonard2: https://forum.zdoom.org/viewtopic.php?p=1028500#p1028500
This commit is contained in:
parent
297f00aa4b
commit
c80c2ba635
1 changed files with 2 additions and 2 deletions
|
@ -132,7 +132,7 @@ int I_WaitForTic(int prevtic)
|
||||||
{
|
{
|
||||||
// The minimum amount of time a thread can sleep is controlled by timeBeginPeriod.
|
// The minimum amount of time a thread can sleep is controlled by timeBeginPeriod.
|
||||||
// We set this to 1 ms in DoMain.
|
// We set this to 1 ms in DoMain.
|
||||||
int sleepTime = prevtic - time;
|
uint64_t sleepTime = NSToMS(FirstFrameStartTime + TicToNS(prevtic + 1) - I_nsTime());
|
||||||
if (sleepTime > 2)
|
if (sleepTime > 2)
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime - 2));
|
std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime - 2));
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ uint64_t I_msTime()
|
||||||
|
|
||||||
int I_GetTime()
|
int I_GetTime()
|
||||||
{
|
{
|
||||||
return NSToTic(CurrentFrameStartTime - FirstFrameStartTime) + 1;
|
return NSToTic(CurrentFrameStartTime - FirstFrameStartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
double I_GetTimeFrac()
|
double I_GetTimeFrac()
|
||||||
|
|
Loading…
Reference in a new issue