mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 07:40:21 +00:00
ddraw: Forbid DDSD_MIPMAPCOUNT without DDSCAPS_COMPLEX.
This commit is contained in:
parent
9bfdd9141c
commit
c86263aa5d
|
@ -6126,6 +6126,14 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
|||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
|
||||
if ((desc->dwFlags & DDSD_MIPMAPCOUNT) && !(desc->ddsCaps.dwCaps & DDSCAPS_COMPLEX))
|
||||
{
|
||||
/* This is illegal even if there is only one mipmap level. */
|
||||
WARN("DDSD_MIPMAPCOUNT specified without DDSCAPS_COMPLEX.\n");
|
||||
heap_free(texture);
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
|
||||
if (desc->ddsCaps.dwCaps & DDSCAPS_FLIP)
|
||||
{
|
||||
if (!(desc->dwFlags & DDSD_BACKBUFFERCOUNT) || !desc->u5.dwBackBufferCount)
|
||||
|
|
|
@ -6323,17 +6323,10 @@ static void test_mipmap(void)
|
|||
if (tests[i].flags & DDSD_MIPMAPCOUNT)
|
||||
U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in;
|
||||
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
if (FAILED(tests[i].hr))
|
||||
{
|
||||
IDirectDrawSurface_Release(surface);
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
|
||||
|
|
|
@ -7452,17 +7452,10 @@ static void test_mipmap(void)
|
|||
if (tests[i].flags & DDSD_MIPMAPCOUNT)
|
||||
U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in;
|
||||
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
if (FAILED(tests[i].hr))
|
||||
{
|
||||
IDirectDrawSurface_Release(surface);
|
||||
continue;
|
||||
}
|
||||
|
||||
hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to get IDirectDrawSurface2 interface, hr %#lx.\n", i, hr);
|
||||
IDirectDrawSurface_Release(surface1);
|
||||
|
|
|
@ -9353,17 +9353,10 @@ static void test_mipmap(void)
|
|||
if (tests[i].flags & DDSD_MIPMAPCOUNT)
|
||||
U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in;
|
||||
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL);
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
if (FAILED(tests[i].hr))
|
||||
{
|
||||
IDirectDrawSurface4_Release(surface);
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc);
|
||||
|
|
|
@ -9197,17 +9197,10 @@ static void test_mipmap(void)
|
|||
if (tests[i].flags & DDSD_MIPMAPCOUNT)
|
||||
U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in;
|
||||
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL);
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
||||
if (FAILED(tests[i].hr))
|
||||
{
|
||||
IDirectDrawSurface7_Release(surface);
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc);
|
||||
|
|
Loading…
Reference in a new issue