mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 14:14:47 +01:00
fix gdi renderer so it also works games other than cnc1 and ra1
This commit is contained in:
parent
fb9db0896f
commit
98ec61d79b
@ -40,8 +40,32 @@ DWORD WINAPI render_soft_main(void)
|
||||
else
|
||||
Sleep(500);
|
||||
|
||||
int maxFPS = ddraw->render.maxfps;
|
||||
DWORD frameLength = 0;
|
||||
DWORD lastTick = 0;
|
||||
|
||||
if (maxFPS < 0)
|
||||
maxFPS = ddraw->mode.dmDisplayFrequency;
|
||||
|
||||
if (maxFPS >= 1000)
|
||||
maxFPS = 0;
|
||||
|
||||
if (maxFPS > 0)
|
||||
frameLength = 1000.0f / maxFPS;
|
||||
|
||||
while (ddraw->render.run && WaitForSingleObject(ddraw->render.sem, INFINITE) != WAIT_FAILED)
|
||||
{
|
||||
if (maxFPS > 0)
|
||||
{
|
||||
DWORD curTick = timeGetTime();
|
||||
if (lastTick + frameLength > curTick)
|
||||
{
|
||||
SetEvent(ddraw->render.ev);
|
||||
continue;
|
||||
}
|
||||
lastTick = curTick;
|
||||
}
|
||||
|
||||
#if _DEBUG
|
||||
DrawFrameInfoStart();
|
||||
#endif
|
||||
|
@ -189,7 +189,7 @@ static void CreateSettingsIni()
|
||||
"; Note: Works only for games that support 'handlemouse=true'\n"
|
||||
"boxing=false\n"
|
||||
"\n"
|
||||
"; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap (OpenGL / Direct3D only)\n"
|
||||
"; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap\n"
|
||||
"maxfps=125\n"
|
||||
"\n"
|
||||
"; Vertical synchronization, enable if you get tearing (OpenGL / Direct3D only)\n"
|
||||
@ -222,7 +222,7 @@ static void CreateSettingsIni()
|
||||
"; Preliminary libretro shader support - e.g. cubic.glsl (OpenGL only) https://github.com/libretro/glsl-shaders\n"
|
||||
"shader=\n"
|
||||
"\n"
|
||||
"; Max game ticks per second, possible values: 1-1000 (Can be used to slow down a too fast running game)\n"
|
||||
"; Max game ticks per second, possible values: 0-1000 (Can be used to slow down a too fast running game)\n"
|
||||
"maxgameticks=0\n"
|
||||
"\n"
|
||||
"; Gives cnc-ddraw full control over the mouse cursor (required for adjmouse/boxing/maintas)\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user