revert LimitGameTicks changes since it's causing flickering in unpatched versions of cnc1 and ra1
This commit is contained in:
parent
f051957ddb
commit
8e75c40cc3
3 changed files with 5 additions and 15 deletions
12
src/main.c
12
src/main.c
|
@ -158,26 +158,18 @@ BOOL detect_cutscene()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void LimitGameTicks(BOOL isBltOrFlip)
|
||||
void LimitGameTicks()
|
||||
{
|
||||
static DWORD nextGameTick;
|
||||
static DWORD lastBltOrFlipTick;
|
||||
if (!nextGameTick)
|
||||
{
|
||||
nextGameTick = timeGetTime();
|
||||
return;
|
||||
}
|
||||
|
||||
nextGameTick += ddraw->ticklength;
|
||||
DWORD tickCount = timeGetTime();
|
||||
|
||||
if (isBltOrFlip)
|
||||
lastBltOrFlipTick = tickCount;
|
||||
else if (lastBltOrFlipTick + (ddraw->ticklength * 2) >= tickCount)
|
||||
return;
|
||||
|
||||
nextGameTick += ddraw->ticklength;
|
||||
int sleepTime = nextGameTick - tickCount;
|
||||
|
||||
if (sleepTime <= 0 || sleepTime > ddraw->ticklength)
|
||||
nextGameTick = tickCount;
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue