mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
fix minWidth and minHeight
This commit is contained in:
parent
ee23027eda
commit
81ef5bad83
@ -459,8 +459,8 @@ BOOL GetLowestResolution(float ratio, SIZE *outRes, DWORD minWidth, DWORD minHei
|
|||||||
|
|
||||||
while (EnumDisplaySettings(NULL, i, &m))
|
while (EnumDisplaySettings(NULL, i, &m))
|
||||||
{
|
{
|
||||||
if (m.dmPelsWidth > minWidth &&
|
if (m.dmPelsWidth >= minWidth &&
|
||||||
m.dmPelsHeight > minHeight &&
|
m.dmPelsHeight >= minHeight &&
|
||||||
m.dmPelsWidth <= maxWidth &&
|
m.dmPelsWidth <= maxWidth &&
|
||||||
m.dmPelsHeight <= maxHeight &&
|
m.dmPelsHeight <= maxHeight &&
|
||||||
m.dmPelsWidth < lowest.cx &&
|
m.dmPelsWidth < lowest.cx &&
|
||||||
@ -629,8 +629,8 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD
|
|||||||
BOOL foundRes = GetLowestResolution(
|
BOOL foundRes = GetLowestResolution(
|
||||||
(float)oldWidth / oldHeight,
|
(float)oldWidth / oldHeight,
|
||||||
&res,
|
&res,
|
||||||
oldWidth,
|
oldWidth + 1, //don't return the original resolution since we tested that one already
|
||||||
oldHeight,
|
oldHeight + 1,
|
||||||
This->mode.dmPelsWidth,
|
This->mode.dmPelsWidth,
|
||||||
This->mode.dmPelsHeight);
|
This->mode.dmPelsHeight);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user