ddraw: Forbid DDSCAPS_COMPLEX without any caps that merit a complex surface.
This commit is contained in:
parent
df8c73e906
commit
9bfdd9141c
5 changed files with 13 additions and 4 deletions
|
@ -6117,6 +6117,15 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
|||
/* Ensure DDSD_CAPS is always set. */
|
||||
desc->dwFlags |= DDSD_CAPS;
|
||||
|
||||
if ((desc->ddsCaps.dwCaps & DDSCAPS_COMPLEX)
|
||||
&& !(desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_MIPMAP))
|
||||
&& !(desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP))
|
||||
{
|
||||
WARN("DDSCAPS_COMPLEX specified for a surface which is neither flippable, mipmapped, nor a cubemap.\n");
|
||||
heap_free(texture);
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
|
||||
if (desc->ddsCaps.dwCaps & DDSCAPS_FLIP)
|
||||
{
|
||||
if (!(desc->dwFlags & DDSD_BACKBUFFERCOUNT) || !desc->u5.dwBackBufferCount)
|
||||
|
|
|
@ -6323,7 +6323,7 @@ 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 == 1 || i == 4 || i == 7 || i == 8)
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
|
|
@ -7452,7 +7452,7 @@ 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 == 1 || i == 4 || i == 7 || i == 8)
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
|
|
@ -9353,7 +9353,7 @@ 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 == 1 || i == 4 || i == 7 || i == 8)
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
|
|
@ -9197,7 +9197,7 @@ 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 == 1 || i == 4 || i == 7 || i == 8)
|
||||
todo_wine_if (i == 7 || i == 8)
|
||||
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
|
||||
if (FAILED(hr))
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue