Commit 62cd08f3 authored by Alexandre Julliard's avatar Alexandre Julliard

ddraw/tests: Use nameless unions/structs.

parent 47cd5b14
......@@ -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);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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);
}
}
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment