ddraw: Fix DDSCAPS_3DDEVICE surfaces always setting DDSCAPS_VISIBLE.

This commit is contained in:
Ričardas Barkauskas 2010-10-24 22:36:43 +03:00 committed by Alexandre Julliard
parent 7402761e21
commit ff659522f6
3 changed files with 9 additions and 4 deletions

View File

@ -3511,12 +3511,17 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
desc->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY; desc->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
} }
if (desc->ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE)) if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{ {
usage |= WINED3DUSAGE_RENDERTARGET; usage |= WINED3DUSAGE_RENDERTARGET;
desc->ddsCaps.dwCaps |= DDSCAPS_VISIBLE; desc->ddsCaps.dwCaps |= DDSCAPS_VISIBLE;
} }
if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
{
usage |= WINED3DUSAGE_RENDERTARGET;
}
if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY)) if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY))
{ {
usage |= WINED3DUSAGE_OVERLAY; usage |= WINED3DUSAGE_OVERLAY;

View File

@ -3593,7 +3593,7 @@ static void BackBuffer3DCreateSurfaceTest(void)
{ {
hr = IDirectDrawSurface_GetSurfaceDesc(surf, &created_ddsd); hr = IDirectDrawSurface_GetSurfaceDesc(surf, &created_ddsd);
ok(SUCCEEDED(hr), "IDirectDraw_GetSurfaceDesc failed: 0x%08x\n", hr); ok(SUCCEEDED(hr), "IDirectDraw_GetSurfaceDesc failed: 0x%08x\n", hr);
todo_wine ok(created_ddsd.ddsCaps.dwCaps == expected_caps, ok(created_ddsd.ddsCaps.dwCaps == expected_caps,
"GetSurfaceDesc returned caps %x, expected %x\n", created_ddsd.ddsCaps.dwCaps, "GetSurfaceDesc returned caps %x, expected %x\n", created_ddsd.ddsCaps.dwCaps,
expected_caps); expected_caps);

View File

@ -2916,7 +2916,7 @@ static void SurfaceCapsTest(void)
hr = IDirectDrawSurface_GetSurfaceDesc(surface1, &desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface1, &desc);
ok(hr == DD_OK, "IDirectDrawSurface_GetSurfaceDesc failed with %08x\n", hr); ok(hr == DD_OK, "IDirectDrawSurface_GetSurfaceDesc failed with %08x\n", hr);
if (!(create_caps[i] & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE))) if (!(create_caps[i] & DDSCAPS_PRIMARYSURFACE))
ok(desc.ddsCaps.dwCaps == expected_caps[i], ok(desc.ddsCaps.dwCaps == expected_caps[i],
"GetSurfaceDesc test %d returned caps %x, expected %x\n", i, "GetSurfaceDesc test %d returned caps %x, expected %x\n", i,
desc.ddsCaps.dwCaps, expected_caps[i]); desc.ddsCaps.dwCaps, expected_caps[i]);
@ -2971,7 +2971,7 @@ static void SurfaceCapsTest(void)
hr = IDirectDrawSurface7_GetSurfaceDesc(surface7, &desc2); hr = IDirectDrawSurface7_GetSurfaceDesc(surface7, &desc2);
ok(hr == DD_OK, "IDirectDrawSurface_GetSurfaceDesc failed with %08x\n", hr); ok(hr == DD_OK, "IDirectDrawSurface_GetSurfaceDesc failed with %08x\n", hr);
if (!(create_caps[i] & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE))) if (!(create_caps[i] & DDSCAPS_PRIMARYSURFACE))
ok(desc2.ddsCaps.dwCaps == expected_caps[i], ok(desc2.ddsCaps.dwCaps == expected_caps[i],
"GetSurfaceDesc test %d returned caps %x, expected %x\n", i, "GetSurfaceDesc test %d returned caps %x, expected %x\n", i,
desc2.ddsCaps.dwCaps, expected_caps[i]); desc2.ddsCaps.dwCaps, expected_caps[i]);