mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
#5 add forcefps bool
This commit is contained in:
parent
da09069d7b
commit
2d94d42e91
@ -85,6 +85,7 @@ typedef struct IDirectDrawImpl
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int maxfps;
|
int maxfps;
|
||||||
|
BOOL forcefps;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int bpp;
|
int bpp;
|
||||||
|
@ -565,7 +565,8 @@ static void Render()
|
|||||||
else if (ddraw->bpp == 16)
|
else if (ddraw->bpp == 16)
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
while (UseOpenGL && ddraw->render.run && WaitForSingleObject(ddraw->render.sem, INFINITE) != WAIT_FAILED)
|
while (UseOpenGL && ddraw->render.run &&
|
||||||
|
(ddraw->render.forcefps || WaitForSingleObject(ddraw->render.sem, INFINITE) != WAIT_FAILED))
|
||||||
{
|
{
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
DrawFrameInfoStart();
|
DrawFrameInfoStart();
|
||||||
|
@ -302,7 +302,8 @@ DWORD WINAPI render_d3d9_main(void)
|
|||||||
DWORD tickEnd = 0;
|
DWORD tickEnd = 0;
|
||||||
BOOL needsUpdate = FALSE;
|
BOOL needsUpdate = FALSE;
|
||||||
|
|
||||||
while (ddraw->render.run && WaitForSingleObject(ddraw->render.sem, 200) != WAIT_FAILED)
|
while (ddraw->render.run &&
|
||||||
|
(ddraw->render.forcefps || WaitForSingleObject(ddraw->render.sem, 200) != WAIT_FAILED))
|
||||||
{
|
{
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
DrawFrameInfoStart();
|
DrawFrameInfoStart();
|
||||||
|
@ -61,7 +61,8 @@ DWORD WINAPI render_soft_main(void)
|
|||||||
ddraw->fpsLimiter.ticklength = len + (ddraw->accurateTimers ? 0.5f : 0.0f);
|
ddraw->fpsLimiter.ticklength = len + (ddraw->accurateTimers ? 0.5f : 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (ddraw->render.run && WaitForSingleObject(ddraw->render.sem, INFINITE) != WAIT_FAILED)
|
while (ddraw->render.run &&
|
||||||
|
(ddraw->render.forcefps || WaitForSingleObject(ddraw->render.sem, INFINITE) != WAIT_FAILED))
|
||||||
{
|
{
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
DrawFrameInfoStart();
|
DrawFrameInfoStart();
|
||||||
|
@ -55,6 +55,9 @@ void Settings_Load()
|
|||||||
|
|
||||||
ddraw->render.maxfps = GetInt("maxfps", 125);
|
ddraw->render.maxfps = GetInt("maxfps", 125);
|
||||||
|
|
||||||
|
if (ddraw->render.maxfps)
|
||||||
|
ddraw->render.forcefps = GetBool("forcefps", FALSE);
|
||||||
|
|
||||||
if (ddraw->accurateTimers || ddraw->vsync)
|
if (ddraw->accurateTimers || ddraw->vsync)
|
||||||
ddraw->fpsLimiter.hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
ddraw->fpsLimiter.hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||||
//can't fully set it up here due to missing ddraw->mode.dmDisplayFrequency
|
//can't fully set it up here due to missing ddraw->mode.dmDisplayFrequency
|
||||||
@ -283,6 +286,10 @@ static void CreateSettingsIni()
|
|||||||
"; Note: Can be used to fix issues related to new features added by cnc-ddraw such as windowed mode or stretching\n"
|
"; Note: Can be used to fix issues related to new features added by cnc-ddraw such as windowed mode or stretching\n"
|
||||||
"hook=1\n"
|
"hook=1\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Force consistent FPS (Requires 'maxfps=' to be set to a value other than 0)\n"
|
||||||
|
"; Note: Fixes flickering cursor issues in C&C games\n"
|
||||||
|
"forcefps=false\n"
|
||||||
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; ### Game specific settings ###\n"
|
"; ### Game specific settings ###\n"
|
||||||
@ -298,10 +305,20 @@ static void CreateSettingsIni()
|
|||||||
"; Command & Conquer Gold\n"
|
"; Command & Conquer Gold\n"
|
||||||
"[C&C95]\n"
|
"[C&C95]\n"
|
||||||
"maxgameticks=120\n"
|
"maxgameticks=120\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert\n"
|
"; Command & Conquer: Red Alert\n"
|
||||||
"[ra95]\n"
|
"[ra95]\n"
|
||||||
"maxgameticks=120\n"
|
"maxgameticks=120\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
|
"\n"
|
||||||
|
"; Command & Conquer: Red Alert\n"
|
||||||
|
"[ra95p]\n"
|
||||||
|
"maxgameticks=120\n"
|
||||||
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Age of Empires\n"
|
"; Age of Empires\n"
|
||||||
"[empires]\n"
|
"[empires]\n"
|
||||||
@ -365,54 +382,63 @@ static void CreateSettingsIni()
|
|||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Tiberian Sun Demo\n"
|
"; Command & Conquer: Tiberian Sun Demo\n"
|
||||||
"[SUN]\n"
|
"[SUN]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Tiberian Sun - CnCNet\n"
|
"; Command & Conquer: Tiberian Sun - CnCNet\n"
|
||||||
"[ts-spawn]\n"
|
"[ts-spawn]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert 2 - XWIS\n"
|
"; Command & Conquer: Red Alert 2 - XWIS\n"
|
||||||
"[ra2]\n"
|
"[ra2]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert 2 - XWIS\n"
|
"; Command & Conquer: Red Alert 2 - XWIS\n"
|
||||||
"[Red Alert 2]\n"
|
"[Red Alert 2]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert 2: Yuri's Revenge\n"
|
"; Command & Conquer: Red Alert 2: Yuri's Revenge\n"
|
||||||
"[gamemd]\n"
|
"[gamemd]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert 2: Yuri's Revenge - ?ModExe?\n"
|
"; Command & Conquer: Red Alert 2: Yuri's Revenge - ?ModExe?\n"
|
||||||
"[ra2md]\n"
|
"[ra2md]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert 2: Yuri's Revenge - CnCNet\n"
|
"; Command & Conquer: Red Alert 2: Yuri's Revenge - CnCNet\n"
|
||||||
"[gamemd-spawn]\n"
|
"[gamemd-spawn]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Command & Conquer: Red Alert 2: Yuri's Revenge - XWIS\n"
|
"; Command & Conquer: Red Alert 2: Yuri's Revenge - XWIS\n"
|
||||||
"[Yuri's Revenge]\n"
|
"[Yuri's Revenge]\n"
|
||||||
"noactivateapp=true\n"
|
"noactivateapp=true\n"
|
||||||
"handlemouse=false\n"
|
"handlemouse=false\n"
|
||||||
"maxfps=60\n"
|
"maxfps=60\n"
|
||||||
|
"forcefps=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
||||||
, fh);
|
, fh);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user