ddraw/tests: Skip cubemap tests when cubemap isn't supported.
This commit is contained in:
parent
c38b2fe09e
commit
e718eae9e2
|
@ -1652,6 +1652,7 @@ static void DeviceLoadTest()
|
|||
IDirectDrawPalette *palettes[5];
|
||||
PALETTEENTRY table1[256];
|
||||
DDCOLORKEY ddckey;
|
||||
D3DDEVICEDESC7 d3dcaps;
|
||||
|
||||
/* Test loading of texture subrectangle with a mipmap surface. */
|
||||
memset(texture_levels, 0, sizeof(texture_levels));
|
||||
|
@ -1858,6 +1859,16 @@ static void DeviceLoadTest()
|
|||
IDirectDrawSurface7_Release(texture_levels[1][0]);
|
||||
memset(texture_levels, 0, sizeof(texture_levels));
|
||||
|
||||
memset(&d3dcaps, 0, sizeof(d3dcaps));
|
||||
hr = IDirect3DDevice7_GetCaps(lpD3DDevice, &d3dcaps);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice7_GetCaps returned %08x\n", hr);
|
||||
|
||||
if (!(d3dcaps.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP))
|
||||
{
|
||||
skip("No cubemap support\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Test loading mipmapped cubemap texture subrectangle from another similar texture. */
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
|
@ -2122,6 +2133,7 @@ static void DeviceLoadTest()
|
|||
IDirectDrawSurface7_Release(cube_face_levels[0][0][0]);
|
||||
IDirectDrawSurface7_Release(cube_face_levels[1][0][0]);
|
||||
memset(cube_face_levels, 0, sizeof(cube_face_levels));
|
||||
}
|
||||
|
||||
/* Test texture loading with different mip level count (larger levels match, smaller levels missing in destination. */
|
||||
for (i = 0; i < 2; i++)
|
||||
|
|
|
@ -1495,7 +1495,7 @@ HRESULT WINAPI CubeTestLvl1Enum(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *de
|
|||
static void CubeMapTest(void)
|
||||
{
|
||||
IDirectDraw7 *dd7 = NULL;
|
||||
IDirectDrawSurface7 *cubemap;
|
||||
IDirectDrawSurface7 *cubemap = NULL;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
HRESULT hr;
|
||||
UINT num = 0;
|
||||
|
@ -1503,6 +1503,7 @@ static void CubeMapTest(void)
|
|||
|
||||
hr = IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw7, (void **) &dd7);
|
||||
ok(hr == DD_OK, "IDirectDraw::QueryInterface returned %08x\n", hr);
|
||||
if (FAILED(hr)) goto err;
|
||||
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
|
@ -1521,7 +1522,11 @@ static void CubeMapTest(void)
|
|||
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
|
||||
|
||||
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL);
|
||||
ok(hr == DD_OK, "IDirectDraw7::CreateSurface returned %08x\n", hr);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
skip("Can't create cubemap surface\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
hr = IDirectDrawSurface7_GetSurfaceDesc(cubemap, &ddsd);
|
||||
ok(hr == DD_OK, "IDirectDrawSurface7_GetSurfaceDesc returned %08x\n", hr);
|
||||
|
@ -1603,7 +1608,8 @@ static void CubeMapTest(void)
|
|||
ok(hr == DD_OK, "IDirectDraw_EnumSurfaces returned %08x\n", hr);
|
||||
ok(ctx.count == 0, "%d surfaces enumerated, expected 0\n", ctx.count);
|
||||
|
||||
IDirectDraw7_Release(dd7);
|
||||
err:
|
||||
if (dd7) IDirectDraw7_Release(dd7);
|
||||
}
|
||||
|
||||
static void test_lockrect_invalid(void)
|
||||
|
|
Loading…
Reference in New Issue