mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
fix custom resolution with high refresh rate monitors
This commit is contained in:
parent
0e2342860b
commit
1e9f3a0ab8
5
src/dd.c
5
src/dd.c
@ -171,6 +171,8 @@ HRESULT dd_EnumDisplayModes(
|
|||||||
m.dmSize = sizeof(DEVMODE);
|
m.dmSize = sizeof(DEVMODE);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
BOOL custom_res_injected = FALSE;
|
||||||
|
|
||||||
while (EnumDisplaySettings(NULL, i, &m))
|
while (EnumDisplaySettings(NULL, i, &m))
|
||||||
{
|
{
|
||||||
if (refresh_rate == m.dmDisplayFrequency &&
|
if (refresh_rate == m.dmDisplayFrequency &&
|
||||||
@ -183,10 +185,11 @@ HRESULT dd_EnumDisplayModes(
|
|||||||
while (--m.dmPelsWidth % 8);
|
while (--m.dmPelsWidth % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0 && g_config.custom_width && g_config.custom_height)
|
if (!custom_res_injected && g_config.custom_width && g_config.custom_height)
|
||||||
{
|
{
|
||||||
m.dmPelsWidth = g_config.custom_width;
|
m.dmPelsWidth = g_config.custom_width;
|
||||||
m.dmPelsHeight = g_config.custom_height;
|
m.dmPelsHeight = g_config.custom_height;
|
||||||
|
custom_res_injected = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE(
|
TRACE(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user