mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
add limiter for max resolution
This commit is contained in:
parent
f2e9b39475
commit
b721757ef7
6
src/dd.c
6
src/dd.c
@ -131,8 +131,14 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
||||
{ 1920, 1080 },
|
||||
};
|
||||
|
||||
DWORD max_w = g_ddraw->mode.dmPelsWidth ? g_ddraw->mode.dmPelsWidth : real_GetSystemMetrics(SM_CXSCREEN);
|
||||
DWORD max_h = g_ddraw->mode.dmPelsHeight ? g_ddraw->mode.dmPelsHeight : real_GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
for (i = 0; i < sizeof(resolutions) / sizeof(resolutions[0]); i++)
|
||||
{
|
||||
if ((max_w && resolutions[i].cx > max_w) || (max_h && resolutions[i].cy > max_h))
|
||||
continue;
|
||||
|
||||
memset(&s, 0, sizeof(DDSURFACEDESC));
|
||||
|
||||
s.dwSize = sizeof(DDSURFACEDESC);
|
||||
|
Loading…
x
Reference in New Issue
Block a user