Commit 1c5bfc12 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard
Browse files

ddraw/tests: Avoid picking a large mode on Win10 in find_different_mode_callback.

parent fc9f3bbf
Pipeline #1867 skipped
......@@ -14224,8 +14224,13 @@ static HRESULT CALLBACK find_different_mode_callback(DDSURFACEDESC *surface_desc
 
if (surface_desc->dwWidth != param->old_width && surface_desc->dwHeight != param->old_height)
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
/* See test_coop_level_mode_set_enum_cb() for why enumeration might accidentally continue. */
if (!param->new_width || (param->new_width < registry_mode.dmPelsWidth
&& param->new_height < registry_mode.dmPelsHeight))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
}
return DDENUMRET_CANCEL;
}
 
......
......@@ -15205,10 +15205,15 @@ static HRESULT CALLBACK find_different_mode_callback(DDSURFACEDESC *surface_desc
if (surface_desc->dwWidth != param->old_width && surface_desc->dwHeight != param->old_height &&
(!compare_uint(surface_desc->dwRefreshRate, param->old_frequency, 1) || !param->old_frequency))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
param->new_frequency = surface_desc->dwRefreshRate;
param->new_bpp = surface_desc->ddpfPixelFormat.dwRGBBitCount;
/* See test_coop_level_mode_set_enum_cb() for why enumeration might accidentally continue. */
if (!param->new_width || (param->new_width < registry_mode.dmPelsWidth
&& param->new_height < registry_mode.dmPelsHeight))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
param->new_frequency = surface_desc->dwRefreshRate;
param->new_bpp = surface_desc->ddpfPixelFormat.dwRGBBitCount;
}
return DDENUMRET_CANCEL;
}
 
......
......@@ -18255,10 +18255,15 @@ static HRESULT CALLBACK find_different_mode_callback(DDSURFACEDESC2 *surface_des
if (surface_desc->dwWidth != param->old_width && surface_desc->dwHeight != param->old_height &&
(!compare_uint(surface_desc->dwRefreshRate, param->old_frequency, 1) || !param->old_frequency))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
param->new_frequency = surface_desc->dwRefreshRate;
param->new_bpp = surface_desc->ddpfPixelFormat.dwRGBBitCount;
/* See test_coop_level_mode_set_enum_cb() for why enumeration might accidentally continue. */
if (!param->new_width || (param->new_width < registry_mode.dmPelsWidth
&& param->new_height < registry_mode.dmPelsHeight))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
param->new_frequency = surface_desc->dwRefreshRate;
param->new_bpp = surface_desc->ddpfPixelFormat.dwRGBBitCount;
}
return DDENUMRET_CANCEL;
}
 
......
......@@ -18522,10 +18522,15 @@ static HRESULT CALLBACK find_different_mode_callback(DDSURFACEDESC2 *surface_des
if (surface_desc->dwWidth != param->old_width && surface_desc->dwHeight != param->old_height &&
(!compare_uint(surface_desc->dwRefreshRate, param->old_frequency, 1) || !param->old_frequency))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
param->new_frequency = surface_desc->dwRefreshRate;
param->new_bpp = surface_desc->ddpfPixelFormat.dwRGBBitCount;
/* See test_coop_level_mode_set_enum_cb() for why enumeration might accidentally continue. */
if (!param->new_width || (param->new_width < registry_mode.dmPelsWidth
&& param->new_height < registry_mode.dmPelsHeight))
{
param->new_width = surface_desc->dwWidth;
param->new_height = surface_desc->dwHeight;
param->new_frequency = surface_desc->dwRefreshRate;
param->new_bpp = surface_desc->ddpfPixelFormat.dwRGBBitCount;
}
return DDENUMRET_CANCEL;
}
 
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment