ddraw/tests: Use nameless unions/structs.

This commit is contained in:
Alexandre Julliard 2023-08-15 16:47:29 +02:00
parent 47cd5b1499
commit 62cd08f387
9 changed files with 1782 additions and 1782 deletions

View file

@ -138,10 +138,10 @@ static BOOL CreateDirect3D(void)
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(U4(ddsd).ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(U4(ddsd).ddpfPixelFormat).dwZBitMask = 0x0000FFFF;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
ddsd.ddpfPixelFormat.dwZBufferBitDepth = 16;
ddsd.ddpfPixelFormat.dwZBitMask = 0x0000FFFF;
ddsd.dwWidth = 256;
ddsd.dwHeight = 256;
rc = IDirectDraw7_CreateSurface(lpDD, &ddsd, &lpDDSdepth, NULL);
@ -236,10 +236,10 @@ static void LightTest(void)
/* Set a few lights with funky indices. */
memset(&light, 0, sizeof(light));
light.dltType = D3DLIGHT_DIRECTIONAL;
U1(light.dcvDiffuse).r = 0.5f;
U2(light.dcvDiffuse).g = 0.6f;
U3(light.dcvDiffuse).b = 0.7f;
U2(light.dvDirection).y = 1.f;
light.dcvDiffuse.r = 0.5f;
light.dcvDiffuse.g = 0.6f;
light.dcvDiffuse.b = 0.7f;
light.dvDirection.y = 1.f;
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 5, &light);
ok(rc==D3D_OK, "Got hr %#lx.\n", rc);
@ -271,10 +271,10 @@ static void LightTest(void)
they have been initialized with proper default values. */
memset(&defaultlight, 0, sizeof(D3DLIGHT7));
defaultlight.dltType = D3DLIGHT_DIRECTIONAL;
U1(defaultlight.dcvDiffuse).r = 1.f;
U2(defaultlight.dcvDiffuse).g = 1.f;
U3(defaultlight.dcvDiffuse).b = 1.f;
U3(defaultlight.dvDirection).z = 1.f;
defaultlight.dcvDiffuse.r = 1.f;
defaultlight.dcvDiffuse.g = 1.f;
defaultlight.dcvDiffuse.b = 1.f;
defaultlight.dvDirection.z = 1.f;
rc = IDirect3DDevice7_LightEnable(lpD3DDevice, 20, TRUE);
ok(rc==D3D_OK, "Got hr %#lx.\n", rc);
@ -320,19 +320,19 @@ static void LightTest(void)
/* Set some lights with invalid parameters */
memset(&light, 0, sizeof(D3DLIGHT7));
light.dltType = 0;
U1(light.dcvDiffuse).r = 1.f;
U2(light.dcvDiffuse).g = 1.f;
U3(light.dcvDiffuse).b = 1.f;
U3(light.dvDirection).z = 1.f;
light.dcvDiffuse.r = 1.f;
light.dcvDiffuse.g = 1.f;
light.dcvDiffuse.b = 1.f;
light.dvDirection.z = 1.f;
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 100, &light);
ok(rc==DDERR_INVALIDPARAMS, "Got hr %#lx.\n", rc);
memset(&light, 0, sizeof(D3DLIGHT7));
light.dltType = 12345;
U1(light.dcvDiffuse).r = 1.f;
U2(light.dcvDiffuse).g = 1.f;
U3(light.dcvDiffuse).b = 1.f;
U3(light.dvDirection).z = 1.f;
light.dcvDiffuse.r = 1.f;
light.dcvDiffuse.g = 1.f;
light.dcvDiffuse.b = 1.f;
light.dvDirection.z = 1.f;
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 101, &light);
ok(rc==DDERR_INVALIDPARAMS, "Got hr %#lx.\n", rc);
@ -341,10 +341,10 @@ static void LightTest(void)
memset(&light, 0, sizeof(D3DLIGHT7));
light.dltType = D3DLIGHT_SPOT;
U1(light.dcvDiffuse).r = 1.f;
U2(light.dcvDiffuse).g = 1.f;
U3(light.dcvDiffuse).b = 1.f;
U3(light.dvDirection).z = 1.f;
light.dcvDiffuse.r = 1.f;
light.dcvDiffuse.g = 1.f;
light.dcvDiffuse.b = 1.f;
light.dvDirection.z = 1.f;
light.dvAttenuation0 = -one / zero; /* -INFINITY */
rc = IDirect3DDevice7_SetLight(lpD3DDevice, 103, &light);
@ -381,21 +381,21 @@ static void LightTest(void)
rc = IDirect3DDevice7_SetMaterial(lpD3DDevice, &mat);
ok(rc == D3D_OK, "Got hr %#lx.\n", rc);
U4(mat).power = 129.0;
mat.power = 129.0;
rc = IDirect3DDevice7_SetMaterial(lpD3DDevice, &mat);
ok(rc == D3D_OK, "Got hr %#lx.\n", rc);
memset(&mat, 0, sizeof(mat));
rc = IDirect3DDevice7_GetMaterial(lpD3DDevice, &mat);
ok(rc == D3D_OK, "Got hr %#lx.\n", rc);
ok(U4(mat).power == 129, "Returned power is %f\n", U4(mat).power);
ok(mat.power == 129, "Returned power is %f\n", mat.power);
U4(mat).power = -1.0;
mat.power = -1.0;
rc = IDirect3DDevice7_SetMaterial(lpD3DDevice, &mat);
ok(rc == D3D_OK, "Got hr %#lx.\n", rc);
memset(&mat, 0, sizeof(mat));
rc = IDirect3DDevice7_GetMaterial(lpD3DDevice, &mat);
ok(rc == D3D_OK, "Got hr %#lx.\n", rc);
ok(U4(mat).power == -1, "Returned power is %f\n", U4(mat).power);
ok(mat.power == -1, "Returned power is %f\n", mat.power);
memset(&caps, 0, sizeof(caps));
rc = IDirect3DDevice7_GetCaps(lpD3DDevice, &caps);
@ -1080,7 +1080,7 @@ static void TextureLoadTest(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 8;
ddsd.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &TexSurface, NULL);
ok(hr==D3D_OK, "Got hr %#lx.\n", hr);
@ -1300,10 +1300,10 @@ static void SetRenderTargetTest(void)
ddsd2.ddsCaps.dwCaps = DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER;
ddsd2.dwWidth = 64;
ddsd2.dwHeight = 64;
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
U4(ddsd2).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(U4(ddsd2).ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(U4(ddsd2).ddpfPixelFormat).dwZBitMask = 0x0000FFFF;
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
ddsd2.ddpfPixelFormat.dwZBufferBitDepth = 16;
ddsd2.ddpfPixelFormat.dwZBitMask = 0x0000FFFF;
hr = IDirectDraw7_CreateSurface(lpDD, &ddsd2, &failrt, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -1657,9 +1657,9 @@ static void BackBuffer3DAttachmentTest(void)
static void dump_format(const DDPIXELFORMAT *fmt)
{
trace("dwFlags %08lx, FourCC %08lx, dwZBufferBitDepth %lu, stencil %08lx\n", fmt->dwFlags, fmt->dwFourCC,
U1(*fmt).dwZBufferBitDepth, U2(*fmt).dwStencilBitDepth);
trace("dwZBitMask %08lx, dwStencilBitMask %08lx, dwRGBZBitMask %08lx\n", U3(*fmt).dwZBitMask,
U4(*fmt).dwStencilBitMask, U5(*fmt).dwRGBZBitMask);
fmt->dwZBufferBitDepth, fmt->dwStencilBitDepth);
trace("dwZBitMask %08lx, dwStencilBitMask %08lx, dwRGBZBitMask %08lx\n", fmt->dwZBitMask,
fmt->dwStencilBitMask, fmt->dwRGBZBitMask);
}
static HRESULT WINAPI enum_z_fmt_cb(DDPIXELFORMAT *fmt, void *ctx)
@ -1705,7 +1705,7 @@ static HRESULT WINAPI enum_z_fmt_cb(DDPIXELFORMAT *fmt, void *ctx)
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U4(ddsd).ddpfPixelFormat = *fmt;
ddsd.ddpfPixelFormat = *fmt;
ddsd.dwWidth = 1024;
ddsd.dwHeight = 1024;
hr = IDirectDraw7_CreateSurface(lpDD, &ddsd, &surface, NULL);
@ -1721,17 +1721,17 @@ static HRESULT WINAPI enum_z_fmt_cb(DDPIXELFORMAT *fmt, void *ctx)
/* 24 bit unpadded depth buffers are actually padded(Geforce 9600, Win7,
* Radeon 9000M WinXP) */
if (U1(*fmt).dwZBufferBitDepth == 24) expected_pitch = ddsd.dwWidth * 4;
else expected_pitch = ddsd.dwWidth * U1(*fmt).dwZBufferBitDepth / 8;
if (fmt->dwZBufferBitDepth == 24) expected_pitch = ddsd.dwWidth * 4;
else expected_pitch = ddsd.dwWidth * fmt->dwZBufferBitDepth / 8;
/* Some formats(16 bit depth without stencil) return pitch 0
*
* The Radeon X1600 Catalyst 10.2 Windows XP driver returns an otherwise sane
* pitch with an extra 128 bytes, regardless of the format and width */
if (U1(ddsd).lPitch != 0 && U1(ddsd).lPitch != expected_pitch
&& !broken(U1(ddsd).lPitch == expected_pitch + 128))
if (ddsd.lPitch != 0 && ddsd.lPitch != expected_pitch
&& !broken(ddsd.lPitch == expected_pitch + 128))
{
ok(0, "Z buffer pitch is %lu, expected %u\n", U1(ddsd).lPitch, expected_pitch);
ok(0, "Z buffer pitch is %lu, expected %u\n", ddsd.lPitch, expected_pitch);
dump_format(fmt);
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -339,13 +339,13 @@ static HRESULT WINAPI enummodescallback(DDSURFACEDESC *lpddsd, void *lpContext)
{
if (winetest_debug > 1)
trace("Width = %li, Height = %li, bpp = %li, Refresh Rate = %li, Pitch = %li, flags = %#lx\n",
lpddsd->dwWidth, lpddsd->dwHeight, U1(lpddsd->ddpfPixelFormat).dwRGBBitCount,
U2(*lpddsd).dwRefreshRate, U1(*lpddsd).lPitch, lpddsd->dwFlags);
lpddsd->dwWidth, lpddsd->dwHeight, lpddsd->ddpfPixelFormat.dwRGBBitCount,
lpddsd->dwRefreshRate, lpddsd->lPitch, lpddsd->dwFlags);
/* Check that the pitch is valid if applicable */
if(lpddsd->dwFlags & DDSD_PITCH)
{
ok(U1(*lpddsd).lPitch != 0, "EnumDisplayModes callback with bad pitch\n");
ok(lpddsd->lPitch != 0, "EnumDisplayModes callback with bad pitch\n");
}
/* Check that frequency is valid if applicable
@ -354,12 +354,12 @@ static HRESULT WINAPI enummodescallback(DDSURFACEDESC *lpddsd, void *lpContext)
* apparently
if(lpddsd->dwFlags & DDSD_REFRESHRATE)
{
ok(U2(*lpddsd).dwRefreshRate != 0, "EnumDisplayModes callback with bad refresh rate\n");
ok(lpddsd->dwRefreshRate != 0, "EnumDisplayModes callback with bad refresh rate\n");
}
*/
adddisplaymode(lpddsd);
if(U1(lpddsd->ddpfPixelFormat).dwRGBBitCount == 16)
if(lpddsd->ddpfPixelFormat.dwRGBBitCount == 16)
modes16bpp_cnt++;
return DDENUMRET_OK;
@ -369,33 +369,33 @@ static HRESULT WINAPI enummodescallback_16bit(DDSURFACEDESC *lpddsd, void *lpCon
{
if (winetest_debug > 1)
trace("Width = %li, Height = %li, bpp = %li, Refresh Rate = %li, Pitch = %li, flags = %#lx\n",
lpddsd->dwWidth, lpddsd->dwHeight, U1(lpddsd->ddpfPixelFormat).dwRGBBitCount,
U2(*lpddsd).dwRefreshRate, U1(*lpddsd).lPitch, lpddsd->dwFlags);
lpddsd->dwWidth, lpddsd->dwHeight, lpddsd->ddpfPixelFormat.dwRGBBitCount,
lpddsd->dwRefreshRate, lpddsd->lPitch, lpddsd->dwFlags);
ok(lpddsd->dwFlags == (DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT|DDSD_PITCH|DDSD_REFRESHRATE),
"Wrong surface description flags %#lx\n", lpddsd->dwFlags);
ok(lpddsd->ddpfPixelFormat.dwFlags == DDPF_RGB, "Wrong pixel format flag %#lx\n",
lpddsd->ddpfPixelFormat.dwFlags);
ok(U1(lpddsd->ddpfPixelFormat).dwRGBBitCount == 16, "Expected 16 bpp got %li\n",
U1(lpddsd->ddpfPixelFormat).dwRGBBitCount);
ok(lpddsd->ddpfPixelFormat.dwRGBBitCount == 16, "Expected 16 bpp got %li\n",
lpddsd->ddpfPixelFormat.dwRGBBitCount);
/* Check that the pitch is valid if applicable */
if(lpddsd->dwFlags & DDSD_PITCH)
{
ok(U1(*lpddsd).lPitch != 0, "EnumDisplayModes callback with bad pitch\n");
ok(lpddsd->lPitch != 0, "EnumDisplayModes callback with bad pitch\n");
}
if(!refresh_rate)
{
if(U2(*lpddsd).dwRefreshRate )
if(lpddsd->dwRefreshRate )
{
refresh_rate = U2(*lpddsd).dwRefreshRate;
refresh_rate = lpddsd->dwRefreshRate;
refresh_rate_cnt++;
}
}
else
{
if(refresh_rate == U2(*lpddsd).dwRefreshRate)
if(refresh_rate == lpddsd->dwRefreshRate)
refresh_rate_cnt++;
}
@ -434,28 +434,28 @@ static void enumdisplaymodes(void)
modes16bpp_cnt = 0;
ddsd.dwFlags = DDSD_PIXELFORMAT;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 16;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0xf800;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x07e0;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x001F;
ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
ddsd.ddpfPixelFormat.dwRBitMask = 0xf800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x07e0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x001F;
rc = IDirectDraw_EnumDisplayModes(lpDD, 0, &ddsd, 0, enummodescallback_16bit);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
ok(modes16bpp_cnt == count, "Expected %d modes got %d\n", count, modes16bpp_cnt);
modes16bpp_cnt = 0;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000;
ddsd.ddpfPixelFormat.dwRBitMask = 0x0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000;
ddsd.ddpfPixelFormat.dwBBitMask = 0x0000;
rc = IDirectDraw_EnumDisplayModes(lpDD, 0, &ddsd, 0, enummodescallback_16bit);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
ok(modes16bpp_cnt == count, "Expected %d modes got %d\n", count, modes16bpp_cnt);
modes16bpp_cnt = 0;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0xF0F0;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0F00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000F;
ddsd.ddpfPixelFormat.dwRBitMask = 0xF0F0;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0F00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000F;
rc = IDirectDraw_EnumDisplayModes(lpDD, 0, &ddsd, 0, enummodescallback_16bit);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
@ -493,7 +493,7 @@ static void enumdisplaymodes(void)
modes16bpp_cnt = 0;
ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_PITCH;
U1(ddsd).lPitch = 123;
ddsd.lPitch = 123;
rc = IDirectDraw_EnumDisplayModes(lpDD, 0, &ddsd, 0, enummodescallback_16bit);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
@ -504,7 +504,7 @@ static void enumdisplaymodes(void)
/* Ask for a refresh rate that could not possibly be used. But note that
* the Windows 'Standard VGA' driver claims to run the display at 1Hz!
*/
U2(ddsd).dwRefreshRate = 2;
ddsd.dwRefreshRate = 2;
rc = IDirectDraw_EnumDisplayModes(lpDD, 0, &ddsd, 0, enummodescallback_16bit);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
@ -526,7 +526,7 @@ static void enumdisplaymodes(void)
{
modes16bpp_cnt = 0;
ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_REFRESHRATE;
U2(ddsd).dwRefreshRate = refresh_rate;
ddsd.dwRefreshRate = refresh_rate;
rc = IDirectDraw_EnumDisplayModes(lpDD, 0, &ddsd, 0, enummodescallback_16bit);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
@ -554,7 +554,7 @@ static void setdisplaymode(int i)
{
rc = IDirectDraw_SetDisplayMode(lpDD,
modes[i].dwWidth, modes[i].dwHeight,
U1(modes[i].ddpfPixelFormat).dwRGBBitCount);
modes[i].ddpfPixelFormat.dwRGBBitCount);
ok(rc == DD_OK || rc == DDERR_UNSUPPORTED, "Got hr %#lx.\n", rc);
if (rc == DD_OK)
{
@ -594,7 +594,7 @@ static void setdisplaymode(int i)
{
rc = IDirectDraw_SetDisplayMode(lpDD,
modes[i].dwWidth, modes[i].dwHeight,
U1(modes[i].ddpfPixelFormat).dwRGBBitCount);
modes[i].ddpfPixelFormat.dwRGBBitCount);
ok(rc == DD_OK, "Got hr %#lx.\n", rc);
}
}

View file

@ -500,7 +500,7 @@ static void CubeMapTest(void)
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
@ -508,11 +508,11 @@ static void CubeMapTest(void)
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES;
/* D3DFMT_R5G6B5 */
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 16;
U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0xF800;
U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x07E0;
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
ddsd.ddpfPixelFormat.dwRBitMask = 0xF800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x07E0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL);
if (FAILED(hr))
@ -537,7 +537,7 @@ static void CubeMapTest(void)
/* What happens if I do not specify any faces? */
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
@ -545,11 +545,11 @@ static void CubeMapTest(void)
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP;
/* D3DFMT_R5G6B5 */
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 16;
U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0xF800;
U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x07E0;
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
ddsd.ddpfPixelFormat.dwRBitMask = 0xF800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x07E0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
@ -557,7 +557,7 @@ static void CubeMapTest(void)
/* Cube map faces without a cube map? */
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
@ -565,18 +565,18 @@ static void CubeMapTest(void)
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP_ALLFACES;
/* D3DFMT_R5G6B5 */
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 16;
U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0xF800;
U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x07E0;
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
ddsd.ddpfPixelFormat.dwRBitMask = 0xF800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x07E0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL);
ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
@ -584,26 +584,26 @@ static void CubeMapTest(void)
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP_POSITIVEX;
/* D3DFMT_R5G6B5 */
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 16;
U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0xF800;
U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x07E0;
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
ddsd.ddpfPixelFormat.dwRBitMask = 0xF800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x07E0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x001F;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL);
ok(hr == DDERR_INVALIDCAPS, "Got hr %#lx.\n", hr);
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP | DDSCAPS_SYSTEMMEMORY;
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES;
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 8;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
ddsd.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &cubemap, NULL);
if (FAILED(hr))
@ -654,13 +654,13 @@ static void CompressedTest(void)
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY;
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_FOURCC;
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -672,21 +672,21 @@ static void CompressedTest(void)
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 8192, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 8192, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.ddsCaps.dwCaps2 == 0, "Caps2: %#lx\n", ddsd2.ddsCaps.dwCaps2);
IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
if (FAILED(hr))
@ -697,20 +697,20 @@ static void CompressedTest(void)
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
if (FAILED(hr))
@ -721,22 +721,22 @@ static void CompressedTest(void)
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface == 0, "Surface memory is at %p, expected NULL\n", ddsd2.lpSurface);
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
/* Show that the description is not changed when locking the surface. What is really interesting
* about this is that DDSD_LPSURFACE isn't set.
@ -746,11 +746,11 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, NULL);
@ -762,11 +762,11 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r);
@ -778,11 +778,11 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r2);
@ -793,7 +793,7 @@ static void CompressedTest(void)
* but seems to have a pitch instead.
*/
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY;
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK || hr == DDERR_NOTEXTUREHW || hr == DDERR_INVALIDPARAMS ||
@ -804,53 +804,53 @@ static void CompressedTest(void)
{
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
/* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */
ok(ddsd2.ddsCaps.dwCaps2 == 0, "Caps2: %#lx\n", ddsd2.ddsCaps.dwCaps2);
IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
/* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */
IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
/* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */
@ -858,7 +858,7 @@ static void CompressedTest(void)
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
/* Show that the description is not changed when locking the surface. What is really interesting
* about this is that DDSD_LPSURFACE isn't set.
@ -868,8 +868,8 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
/* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */
@ -884,8 +884,8 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
/* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */
@ -900,8 +900,8 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
/* ATI drivers report a broken linear size, thus no need to clone the exact behaviour. nvidia reports the correct size */
@ -922,7 +922,7 @@ static void CompressedTest(void)
*/
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','1');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK || hr == DDERR_NOTEXTUREHW, "Got hr %#lx.\n", hr);
@ -932,61 +932,61 @@ static void CompressedTest(void)
{
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 8192, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 8192, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.ddsCaps.dwCaps2 == DDSCAPS2_TEXTUREMANAGE, "Caps2: %#lx\n", ddsd2.ddsCaps.dwCaps2);
IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','3');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
IDirectDrawSurface7_Release(surface);
U4(ddsd).ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
ddsd.ddpfPixelFormat.dwFourCC = MAKEFOURCC('D','X','T','5');
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd2);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface == 0, "Surface memory is at %p, expected NULL\n", ddsd2.lpSurface);
memset(&ddsd2, 0, sizeof(ddsd2));
ddsd2.dwSize = sizeof(ddsd2);
U4(ddsd2).ddpfPixelFormat.dwSize = sizeof(U4(ddsd2).ddpfPixelFormat);
ddsd2.ddpfPixelFormat.dwSize = sizeof(ddsd2.ddpfPixelFormat);
/* Show that the description is not changed when locking the surface. What is really interesting
* about this is that DDSD_LPSURFACE isn't set.
@ -996,11 +996,11 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "Linear size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "Linear size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, NULL);
@ -1012,11 +1012,11 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "\"Linear\" size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "\"Linear\" size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r);
@ -1028,11 +1028,11 @@ static void CompressedTest(void)
ok(ddsd2.dwFlags == (DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LINEARSIZE),
"Surface desc flags: %#lx\n", ddsd2.dwFlags);
ok(U4(ddsd2).ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", U4(ddsd2).ddpfPixelFormat.dwFlags);
ok(U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount == 0, "RGB bitcount: %#lx\n", U1(U4(ddsd2).ddpfPixelFormat).dwRGBBitCount);
ok(ddsd2.ddpfPixelFormat.dwFlags == DDPF_FOURCC, "Pixel format flags: %#lx\n", ddsd2.ddpfPixelFormat.dwFlags);
ok(ddsd2.ddpfPixelFormat.dwRGBBitCount == 0, "RGB bitcount: %#lx\n", ddsd2.ddpfPixelFormat.dwRGBBitCount);
ok(ddsd2.ddsCaps.dwCaps == (DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY),
"Surface caps flags: %#lx\n", ddsd2.ddsCaps.dwCaps);
ok(U1(ddsd2).dwLinearSize == 16384, "\"Linear\" size is %lu\n", U1(ddsd2).dwLinearSize);
ok(ddsd2.dwLinearSize == 16384, "\"Linear\" size is %lu\n", ddsd2.dwLinearSize);
ok(ddsd2.lpSurface != 0, "Surface memory is at NULL\n");
hr = IDirectDrawSurface7_Unlock(surface, &r2);
@ -1230,7 +1230,7 @@ static void BltParamTest(void)
/* Blt(non-fast) tests */
memset(&BltFx, 0, sizeof(BltFx));
BltFx.dwSize = sizeof(BltFx);
U5(BltFx).dwFillColor = 0xaabbccdd;
BltFx.dwFillColor = 0xaabbccdd;
hr = IDirectDrawSurface_Blt(surface1, &valid, NULL, NULL, DDBLT_COLORFILL, &BltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -1364,10 +1364,10 @@ static void PaletteTest(void)
ddsd.dwWidth = 800;
ddsd.dwHeight = 600;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0xFF0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x00FF00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x0000FF;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0xFF0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x00FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x0000FF;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSurf, NULL);
ok(hr==DD_OK, "Got hr %#lx.\n", hr);
if (FAILED(hr))
@ -1401,7 +1401,7 @@ static void PaletteTest(void)
ddsd.dwHeight = 64;
ddsd.dwBackBufferCount = 1;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 8;
ddsd.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSurf, NULL);
ok(hr==DD_OK, "Got hr %#lx.\n", hr);
@ -1493,8 +1493,8 @@ static void SurfaceCapsTest(void)
create.dwFlags |= DDSD_PIXELFORMAT;
create.ddpfPixelFormat.dwSize = sizeof(create.ddpfPixelFormat);
create.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(create.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(create.ddpfPixelFormat).dwZBitMask = 0x0000FFFF;
create.ddpfPixelFormat.dwZBufferBitDepth = 16;
create.ddpfPixelFormat.dwZBitMask = 0x0000FFFF;
}
hr = IDirectDraw_CreateSurface(lpDD, &create, &surface1, NULL);
@ -1541,10 +1541,10 @@ static void SurfaceCapsTest(void)
if (create2.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
{
create2.dwFlags |= DDSD_PIXELFORMAT;
U4(create2).ddpfPixelFormat.dwSize = sizeof(U4(create2).ddpfPixelFormat);
U4(create2).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(U4(create2).ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(U4(create2).ddpfPixelFormat).dwZBitMask = 0x0000FFFF;
create2.ddpfPixelFormat.dwSize = sizeof(create2.ddpfPixelFormat);
create2.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
create2.ddpfPixelFormat.dwZBufferBitDepth = 16;
create2.ddpfPixelFormat.dwZBitMask = 0x0000FFFF;
}
hr = IDirectDraw7_CreateSurface(dd7, &create2, &surface7, NULL);
@ -1962,9 +1962,9 @@ static void no_ddsd_caps_test(void)
static void dump_format(const DDPIXELFORMAT *fmt)
{
trace("dwFlags %#lx, FourCC %#lx, dwZBufferBitDepth %lu, stencil %lu\n", fmt->dwFlags, fmt->dwFourCC,
U1(*fmt).dwZBufferBitDepth, U2(*fmt).dwStencilBitDepth);
trace("dwZBitMask %#lx, dwStencilBitMask %#lx, dwRGBZBitMask %#lx\n", U3(*fmt).dwZBitMask,
U4(*fmt).dwStencilBitMask, U5(*fmt).dwRGBZBitMask);
fmt->dwZBufferBitDepth, fmt->dwStencilBitDepth);
trace("dwZBitMask %#lx, dwStencilBitMask %#lx, dwRGBZBitMask %#lx\n", fmt->dwZBitMask,
fmt->dwStencilBitMask, fmt->dwRGBZBitMask);
}
static void zbufferbitdepth_test(void)
@ -2044,7 +2044,7 @@ static void zbufferbitdepth_test(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
ddsd.dwWidth = 256;
ddsd.dwHeight = 256;
U2(ddsd).dwZBufferBitDepth = test_data[i].depth;
ddsd.dwZBufferBitDepth = test_data[i].depth;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
if (test_data[i].supported == ZFMT_SUPPORTED_ALWAYS)
@ -2078,11 +2078,11 @@ static void zbufferbitdepth_test(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
ddsd.dwWidth = 256;
ddsd.dwHeight = 256;
U2(ddsd).dwZBufferBitDepth = 24;
ddsd.dwZBufferBitDepth = 24;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(ddsd.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
ddsd.ddpfPixelFormat.dwZBufferBitDepth = 16;
ddsd.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
surface = NULL;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
@ -2092,12 +2092,12 @@ static void zbufferbitdepth_test(void)
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
IDirectDrawSurface_Release(surface);
ok(U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %lu bpp\n",
U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth);
ok(ddsd.ddpfPixelFormat.dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %lu bpp\n",
ddsd.ddpfPixelFormat.dwZBufferBitDepth);
ok(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH is not set\n");
ok(!(ddsd.dwFlags & DDSD_PIXELFORMAT), "DDSD_PIXELFORMAT is set\n");
ok(U2(ddsd).dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %lu\n",
U2(ddsd).dwZBufferBitDepth);
ok(ddsd.dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %lu\n",
ddsd.dwZBufferBitDepth);
/* DDSD_PIXELFORMAT vs invalid ZBUFFERBITDEPTH */
reset_ddsd(&ddsd);
@ -2105,11 +2105,11 @@ static void zbufferbitdepth_test(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
ddsd.dwWidth = 256;
ddsd.dwHeight = 256;
U2(ddsd).dwZBufferBitDepth = 40;
ddsd.dwZBufferBitDepth = 40;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(ddsd.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
ddsd.ddpfPixelFormat.dwZBufferBitDepth = 16;
ddsd.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
surface = NULL;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
@ -2123,8 +2123,8 @@ static void zbufferbitdepth_test(void)
ddsd.dwHeight = 256;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(ddsd.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
ddsd.ddpfPixelFormat.dwZBufferBitDepth = 16;
ddsd.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
surface = NULL;
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
@ -2132,12 +2132,12 @@ static void zbufferbitdepth_test(void)
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &ddsd);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
IDirectDrawSurface_Release(surface);
ok(U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %lu bpp\n",
U1(ddsd.ddpfPixelFormat).dwZBufferBitDepth);
ok(ddsd.ddpfPixelFormat.dwZBufferBitDepth == 16, "Expected a 16bpp depth buffer, got %lu bpp\n",
ddsd.ddpfPixelFormat.dwZBufferBitDepth);
ok(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH is not set\n");
ok(!(ddsd.dwFlags & DDSD_PIXELFORMAT), "DDSD_PIXELFORMAT is set\n");
ok(U2(ddsd).dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %lu\n",
U2(ddsd).dwZBufferBitDepth);
ok(ddsd.dwZBufferBitDepth == 16, "Expected dwZBufferBitDepth=16, got %lu\n",
ddsd.dwZBufferBitDepth);
}
static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const char *name, DWORD z_bit_depth)
@ -2181,20 +2181,20 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const
if (expect_zd)
{
ok(out.dwFlags & DDSD_ZBUFFERBITDEPTH, "%s surface: Expected DDSD_ZBUFFERBITDEPTH to be set\n", name);
ok(U2(out).dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %lu, expected %lu\n",
U2(out).dwZBufferBitDepth, z_bit_depth);
ok(out.dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %lu, expected %lu\n",
out.dwZBufferBitDepth, z_bit_depth);
ok(!(out2.dwFlags & DDSD_ZBUFFERBITDEPTH),
"%s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2\n", name);
/* dwMipMapCount and dwZBufferBitDepth share the same union */
ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", U2(out2).dwMipMapCount);
ok(out2.dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", out2.dwMipMapCount);
}
else
{
ok(!(out.dwFlags & DDSD_ZBUFFERBITDEPTH), "%s surface: Expected DDSD_ZBUFFERBITDEPTH not to be set\n", name);
ok(U2(out).dwZBufferBitDepth == 0, "ZBufferBitDepth is %lu, expected 0\n", U2(out).dwZBufferBitDepth);
ok(out.dwZBufferBitDepth == 0, "ZBufferBitDepth is %lu, expected 0\n", out.dwZBufferBitDepth);
ok(!(out2.dwFlags & DDSD_ZBUFFERBITDEPTH),
"%s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2\n", name);
ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", U2(out2).dwMipMapCount);
ok(out2.dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", out2.dwMipMapCount);
}
reset_ddsd(&out);
@ -2222,10 +2222,10 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const
"Lock %s surface: Expected DDSD_PIXELFORMAT not to be set\n", name);
}
if (out.dwFlags & DDSD_ZBUFFERBITDEPTH)
ok(U2(out).dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %lu, expected %lu\n",
U2(out).dwZBufferBitDepth, z_bit_depth);
ok(out.dwZBufferBitDepth == z_bit_depth, "ZBufferBitDepth is %lu, expected %lu\n",
out.dwZBufferBitDepth, z_bit_depth);
else
ok(U2(out).dwZBufferBitDepth == 0, "ZBufferBitDepth is %lu, expected 0\n", U2(out).dwZBufferBitDepth);
ok(out.dwZBufferBitDepth == 0, "ZBufferBitDepth is %lu, expected 0\n", out.dwZBufferBitDepth);
}
hr = IDirectDrawSurface7_Lock(surface7, NULL, &out2, 0, NULL);
@ -2239,7 +2239,7 @@ static void test_ddsd(DDSURFACEDESC *ddsd, BOOL expect_pf, BOOL expect_zd, const
"Lock %s surface: Expected DDSD_PIXELFORMAT to be set in DDSURFACEDESC2\n", name);
ok(!(out2.dwFlags & DDSD_ZBUFFERBITDEPTH),
"Lock %s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2\n", name);
ok(U2(out2).dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", U2(out2).dwMipMapCount);
ok(out2.dwMipMapCount == 0, "dwMipMapCount is %lu, expected 0\n", out2.dwMipMapCount);
}
IDirectDrawSurface7_Release(surface7);
@ -2278,7 +2278,7 @@ static void pixelformat_flag_test(void)
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_ZBUFFERBITDEPTH;
ddsd.dwWidth = 64;
ddsd.dwHeight = 64;
U2(ddsd).dwZBufferBitDepth = 16;
ddsd.dwZBufferBitDepth = 16;
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
test_ddsd(&ddsd, FALSE, TRUE, "Z buffer", 16);
}
@ -2378,8 +2378,8 @@ static void partial_block_lock_test(void)
ddsd.dwHeight = 128;
ddsd.ddsCaps.dwCaps = pools[j].caps | formats[i].caps;
ddsd.ddsCaps.dwCaps2 = pools[j].caps2;
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_FOURCC;
U4(ddsd).ddpfPixelFormat.dwFourCC = formats[i].fourcc;
ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
ddsd.ddpfPixelFormat.dwFourCC = formats[i].fourcc;
hr = IDirectDraw7_CreateSurface(dd7, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "CreateSurface failed, hr %#lx, format %s, pool %s\n",
hr, formats[i].name, pools[j].name);

View file

@ -90,9 +90,9 @@ static void test_ddraw_objects(void)
ddsd.dwWidth = 64;
ddsd.dwHeight = 64;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 8;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw7_CreateSurface(DDraw7, &ddsd, &surface, NULL);
if (!surface)

View file

@ -64,7 +64,7 @@ static HRESULT WINAPI enum_z_fmt(DDPIXELFORMAT *fmt, void *ctx)
{
DDPIXELFORMAT *zfmt = ctx;
if(U1(*fmt).dwZBufferBitDepth > U1(*zfmt).dwZBufferBitDepth)
if(fmt->dwZBufferBitDepth > zfmt->dwZBufferBitDepth)
{
*zfmt = *fmt;
}
@ -133,7 +133,7 @@ static BOOL createObjects(void)
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
U5(ddsd).dwBackBufferCount = 1;
ddsd.dwBackBufferCount = 1;
hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &Surface, NULL);
if(FAILED(hr)) goto err;
@ -150,7 +150,7 @@ static BOOL createObjects(void)
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U4(ddsd).ddpfPixelFormat = zfmt;
ddsd.ddpfPixelFormat = zfmt;
ddsd.dwWidth = 640;
ddsd.dwHeight = 480;
hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &depth_buffer, NULL);
@ -198,7 +198,7 @@ static DWORD getPixelColor(IDirect3DDevice7 *device, UINT x, UINT y)
*/
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
ddsd.dwWidth = 640;
ddsd.dwHeight = 480;
@ -213,7 +213,7 @@ static DWORD getPixelColor(IDirect3DDevice7 *device, UINT x, UINT y)
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
hr = IDirectDrawSurface_BltFast(surf, 0, 0, Surface, NULL, 0);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -558,7 +558,7 @@ static void offscreen_test(IDirect3DDevice7 *device)
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
@ -692,12 +692,12 @@ static void test_blend(IDirect3DDevice7 *device)
ddsd.dwWidth = 128;
ddsd.dwHeight = 128;
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE;
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 32;
U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(U4(ddsd).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000ff;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &offscreen, NULL);
ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if(!offscreen) {
@ -884,7 +884,7 @@ static DWORD D3D3_getPixelColor(IDirectDraw4 *DirectDraw, IDirectDrawSurface4 *S
*/
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
ddsd.dwWidth = 640;
ddsd.dwHeight = 480;
@ -899,7 +899,7 @@ static DWORD D3D3_getPixelColor(IDirectDraw4 *DirectDraw, IDirectDrawSurface4 *S
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
hr = IDirectDrawSurface4_BltFast(surf, 0, 0, Surface, NULL, 0);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -1085,9 +1085,9 @@ static void D3D3_ViewportClearTest(void)
ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr)) {
U1(rect).x1 = U2(rect).y1 = 0;
U3(rect).x2 = 640;
U4(rect).y2 = 480;
rect.x1 = rect.y1 = 0;
rect.x2 = 640;
rect.y2 = 480;
hr = IDirect3DViewport3_Clear2(Viewport3, 1, &rect, D3DCLEAR_TARGET, 0x00ff00, 0.0f, 0);
ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
@ -1230,24 +1230,24 @@ static void cubemap_test(IDirect3DDevice7 *device)
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = 16;
ddsd.dwHeight = 16;
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX;
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES | DDSCAPS2_TEXTUREMANAGE;
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 32;
U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0x00FF0000;
U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000FF00;
U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000FF;
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF;
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &cubemap, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
IDirectDraw7_Release(ddraw);
/* Positive X */
U5(DDBltFx).dwFillColor = 0x00ff0000;
DDBltFx.dwFillColor = 0x00ff0000;
hr = IDirectDrawSurface7_Blt(cubemap, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -1256,35 +1256,35 @@ static void cubemap_test(IDirect3DDevice7 *device)
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX;
hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(DDBltFx).dwFillColor = 0x0000ffff;
DDBltFx.dwFillColor = 0x0000ffff;
hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ;
hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(DDBltFx).dwFillColor = 0x0000ff00;
DDBltFx.dwFillColor = 0x0000ff00;
hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ;
hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(DDBltFx).dwFillColor = 0x000000ff;
DDBltFx.dwFillColor = 0x000000ff;
hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY;
hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(DDBltFx).dwFillColor = 0x00ffff00;
DDBltFx.dwFillColor = 0x00ffff00;
hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY;
hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(DDBltFx).dwFillColor = 0x00ff00ff;
DDBltFx.dwFillColor = 0x00ff00ff;
hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -1530,10 +1530,10 @@ static void DX1_BackBufferFlipTest(void)
ddsd.dwHeight = 480;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Backbuffer, NULL);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
@ -1547,11 +1547,11 @@ static void DX1_BackBufferFlipTest(void)
memset(&ddbltfx, 0, sizeof(ddbltfx));
ddbltfx.dwSize = sizeof(ddbltfx);
U5(ddbltfx).dwFillColor = red;
ddbltfx.dwFillColor = red;
hr = IDirectDrawSurface_Blt(Backbuffer, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);
U5(ddbltfx).dwFillColor = white;
ddbltfx.dwFillColor = white;
hr = IDirectDrawSurface_Blt(Primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
ok(hr == DD_OK, "Got hr %#lx.\n", hr);