mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +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
|
else
|
||||||
Sleep(500);
|
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)
|
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
|
#if _DEBUG
|
||||||
DrawFrameInfoStart();
|
DrawFrameInfoStart();
|
||||||
#endif
|
#endif
|
||||||
|
@ -189,7 +189,7 @@ static void CreateSettingsIni()
|
|||||||
"; Note: Works only for games that support 'handlemouse=true'\n"
|
"; Note: Works only for games that support 'handlemouse=true'\n"
|
||||||
"boxing=false\n"
|
"boxing=false\n"
|
||||||
"\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"
|
"maxfps=125\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Vertical synchronization, enable if you get tearing (OpenGL / Direct3D only)\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"
|
"; Preliminary libretro shader support - e.g. cubic.glsl (OpenGL only) https://github.com/libretro/glsl-shaders\n"
|
||||||
"shader=\n"
|
"shader=\n"
|
||||||
"\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"
|
"maxgameticks=0\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Gives cnc-ddraw full control over the mouse cursor (required for adjmouse/boxing/maintas)\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