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

fix minWidth and minHeight

This commit is contained in:
FunkyFr3sh 2018-11-25 15:38:43 +01:00
parent ee23027eda
commit 81ef5bad83

View File

@ -459,8 +459,8 @@ BOOL GetLowestResolution(float ratio, SIZE *outRes, DWORD minWidth, DWORD minHei
while (EnumDisplaySettings(NULL, i, &m))
{
if (m.dmPelsWidth > minWidth &&
m.dmPelsHeight > minHeight &&
if (m.dmPelsWidth >= minWidth &&
m.dmPelsHeight >= minHeight &&
m.dmPelsWidth <= maxWidth &&
m.dmPelsHeight <= maxHeight &&
m.dmPelsWidth < lowest.cx &&
@ -629,8 +629,8 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
BOOL foundRes = GetLowestResolution(
(float)oldWidth / oldHeight,
&res,
oldWidth,
oldHeight,
oldWidth + 1, //don't return the original resolution since we tested that one already
oldHeight + 1,
This->mode.dmPelsWidth,
This->mode.dmPelsHeight);