make maxgameticks working via surface unlock for atomic bomberman
This commit is contained in:
parent
0e3e7659cb
commit
bdb5675459
4 changed files with 19 additions and 5 deletions
12
src/main.c
12
src/main.c
|
@ -133,18 +133,26 @@ BOOL detect_cutscene()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void LimitGameTicks()
|
||||
void LimitGameTicks(BOOL isBltOrFlip)
|
||||
{
|
||||
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 >= 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