mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 14:14:47 +01:00
allow to disable all game speed limiters
This commit is contained in:
parent
2c629cbe55
commit
475955d8ef
@ -1752,13 +1752,14 @@ HRESULT __stdcall ddraw_WaitForVerticalBlank(IDirectDrawImpl *This, DWORD dwFlag
|
||||
#if _DEBUG_X
|
||||
printf("DirectDraw::WaitForVerticalBlank(This=%p, flags=%08X, handle=%p)\n", This, dwFlags, h);
|
||||
#endif
|
||||
|
||||
FILETIME lastFlipFT = { 0 };
|
||||
if (ddraw->flipLimiter.hTimer)
|
||||
GetSystemTimeAsFileTime(&lastFlipFT);
|
||||
if (!ddraw->flipLimiter.ticklength)
|
||||
return DD_OK;
|
||||
|
||||
if (ddraw->flipLimiter.hTimer)
|
||||
{
|
||||
FILETIME lastFlipFT = { 0 };
|
||||
GetSystemTimeAsFileTime(&lastFlipFT);
|
||||
|
||||
if (!ddraw->flipLimiter.dueTime.QuadPart)
|
||||
{
|
||||
memcpy(&ddraw->flipLimiter.dueTime, &lastFlipFT, sizeof(LARGE_INTEGER));
|
||||
|
@ -78,14 +78,16 @@ void Settings_Load()
|
||||
ddraw->ticksLimiter.ticklength = len + 0.5f;
|
||||
}
|
||||
|
||||
//always using 60 fps for flip...
|
||||
if (ddraw->accurateTimers)
|
||||
ddraw->flipLimiter.hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||
|
||||
float flipLen = 1000.0f / 60;
|
||||
ddraw->flipLimiter.tickLengthNs = flipLen * 10000;
|
||||
ddraw->flipLimiter.ticklength = flipLen + 0.5f;
|
||||
if (maxTicks >= 0)
|
||||
{
|
||||
//always using 60 fps for flip...
|
||||
if (ddraw->accurateTimers)
|
||||
ddraw->flipLimiter.hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||
|
||||
float flipLen = 1000.0f / 60;
|
||||
ddraw->flipLimiter.tickLengthNs = flipLen * 10000;
|
||||
ddraw->flipLimiter.ticklength = flipLen + 0.5f;
|
||||
}
|
||||
|
||||
if ((ddraw->fullscreen = GetBool("fullscreen", FALSE)))
|
||||
WindowRect.left = WindowRect.top = -32000;
|
||||
@ -277,7 +279,7 @@ static void CreateSettingsIni()
|
||||
"; Hide WM_ACTIVATEAPP messages to prevent problems on alt+tab\n"
|
||||
"noactivateapp=false\n"
|
||||
"\n"
|
||||
"; Max game ticks per second, possible values: 0-1000\n"
|
||||
"; Max game ticks per second, possible values: -1 = disabled, 0 = emulate 60hz vblank, 1-1000 = custom game speed\n"
|
||||
"; Note: Can be used to slow down a too fast running game, fix flickering or too fast animations\n"
|
||||
"maxgameticks=0\n"
|
||||
"\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user