1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

tweak custom resolution settings

This commit is contained in:
FunkyFr3sh 2023-09-14 01:06:37 +02:00
parent a13cdc159e
commit 3d413c5d93
2 changed files with 11 additions and 2 deletions

View File

@ -368,6 +368,8 @@ static void cfg_create_ini()
"no_dinput_hook=false\n"
"refresh_rate=0\n"
"non_anti_aliased_fonts=true\n"
"custom_width=0\n"
"custom_height=0\n"
"\n"
"\n"
"\n"

View File

@ -179,6 +179,12 @@ HRESULT dd_EnumDisplayModes(
while (--m.dmPelsWidth % 8);
}
if (i == 0 && g_ddraw->custom_width && g_ddraw->custom_height)
{
m.dmPelsWidth = g_ddraw->custom_width;
m.dmPelsHeight = g_ddraw->custom_height;
}
TRACE(
" %u: %ux%u@%u %u bpp\n",
i,
@ -291,7 +297,8 @@ HRESULT dd_EnumDisplayModes(
if (!resolutions[i].cx || !resolutions[i].cy)
continue;
if ((max_w && resolutions[i].cx > max_w) || (max_h && resolutions[i].cy > max_h))
if (!(resolutions[i].cx == g_ddraw->custom_width && resolutions[i].cy == g_ddraw->custom_height) &&
((max_w && resolutions[i].cx > max_w) || (max_h && resolutions[i].cy > max_h)))
{
DEVMODE m;
memset(&m, 0, sizeof(DEVMODE));
@ -304,7 +311,7 @@ HRESULT dd_EnumDisplayModes(
if (ChangeDisplaySettings(&m, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
continue;
}
DebugBreak();
memset(&s, 0, sizeof(s));
s.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);