Commit cb03e216 authored by Riccardo Bortolato's avatar Riccardo Bortolato Committed by Alexandre Julliard

ddraw: Check for mipmap sublevel through caps in ddraw_surface7_SetColorKey().

Enabled some previously failing tests in ddraw/tests/ddraw7.c. Signed-off-by: 's avatarRiccardo Bortolato <rikyz619@gmail.com> Signed-off-by: 's avatarStefan Dösinger <stefandoesinger@gmx.at> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d2d8d8f1
......@@ -4726,13 +4726,8 @@ static HRESULT WINAPI ddraw_surface7_SetColorKey(IDirectDrawSurface7 *iface, DWO
TRACE("iface %p, flags %#x, color_key %p.\n", iface, flags, color_key);
wined3d_mutex_lock();
if (!surface->wined3d_texture)
{
wined3d_mutex_unlock();
if (surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL)
return DDERR_NOTONMIPMAPSUBLEVEL;
}
wined3d_mutex_unlock();
return ddraw_surface_set_color_key(surface, flags, color_key);
}
......
......@@ -1764,15 +1764,15 @@ static void test_ck_complex(void)
color_key.dwColorSpaceLowValue = 0x000000ff;
color_key.dwColorSpaceHighValue = 0x000000ff;
hr = IDirectDrawSurface7_SetColorKey(mipmap, DDCKEY_SRCBLT, &color_key);
todo_wine ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr);
color_key.dwColorSpaceLowValue = 0;
color_key.dwColorSpaceHighValue = 0;
hr = IDirectDrawSurface7_GetColorKey(mipmap, DDCKEY_SRCBLT, &color_key);
todo_wine ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr);
todo_wine ok(color_key.dwColorSpaceLowValue == 0x000000ff, "Got unexpected value 0x%08x.\n",
ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr);
ok(color_key.dwColorSpaceLowValue == 0x000000ff, "Got unexpected value 0x%08x.\n",
color_key.dwColorSpaceLowValue);
todo_wine ok(color_key.dwColorSpaceHighValue == 0x000000ff, "Got unexpected value 0x%08x.\n",
ok(color_key.dwColorSpaceHighValue == 0x000000ff, "Got unexpected value 0x%08x.\n",
color_key.dwColorSpaceHighValue);
IDirectDrawSurface_AddRef(mipmap);
......
Markdown is supported
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