From 37af4e6ee409507b95f467719f36a996fdd02515 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Tue, 6 Oct 2020 20:43:40 +0200 Subject: [PATCH] add 2 new .ini settings "nonexclusive" and "resizable" --- inc/main.h | 1 + src/main.c | 3 ++- src/settings.c | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/inc/main.h b/inc/main.h index 5080845..9e12e5e 100644 --- a/inc/main.h +++ b/inc/main.h @@ -133,6 +133,7 @@ typedef struct IDirectDrawImpl BOOL resizable; BOOL tm2hack; BOOL sierrahack; + BOOL nonexclusive; BOOL bnetActive; BOOL bnetWasFullscreen; BOOL bnetWasUpscaled; diff --git a/src/main.c b/src/main.c index 93f2f38..72a73bb 100644 --- a/src/main.c +++ b/src/main.c @@ -863,7 +863,8 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD } } - //if (!ddraw->windowed && ddraw->renderer == render_main) This->render.height++; + if (ddraw->nonexclusive && !ddraw->windowed && ddraw->renderer == render_main) + This->render.height++; if (!ddraw->handlemouse) This->boxing = maintas = FALSE; diff --git a/src/settings.c b/src/settings.c index df4a37c..121044c 100644 --- a/src/settings.c +++ b/src/settings.c @@ -44,6 +44,7 @@ void Settings_Load() ddraw->vhack = GetBool("vhack", FALSE); ddraw->accurateTimers = GetBool("accuratetimers", FALSE); ddraw->resizable = GetBool("resizable", TRUE); + ddraw->nonexclusive = GetBool("nonexclusive", FALSE); ddraw->tm2hack = GetBool("tm2hack", FALSE); // Twisted Metal 2 hack ddraw->sierrahack = GetBool("sierrahack", FALSE); // Sierra Caesar III, Pharaoh, and Zeus hack @@ -267,6 +268,9 @@ static void CreateSettingsIni() "; Possible values: 0 = disabled, 1 = save to global 'ddraw' section, 2 = save to game specific section\n" "savesettings=2\n" "\n" + "; Should the window be resizeable by the user in windowed mode?\n" + "resizeable=true\n" + "\n" "; Enable C&C video resize hack - Stretches C&C cutscenes to fullscreen\n" "vhack=false\n" "\n" @@ -292,9 +296,13 @@ static void CreateSettingsIni() "hook=4\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" + "; Note: Fixes flickering cursor issues in C&C games (Might be useful for some screen recorders too)\n" "forcefps=false\n" "\n" + "; Disable fullscreen-exclusive mode for the OpenGL renderer\n" + "; Note: Can be used in case some GUI elements like buttons/textboxes/videos/etc.. are invisible\n" + "nonexclusive=false\n" + "\n" "; Force CPU0 affinity, avoids crashes/freezing, *might* have a performance impact\n" "singlecpu=true\n" "\n"