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);
}
......
......@@ -373,7 +373,7 @@ static void fill_surface(IDirectDrawSurface *surface, D3DCOLOR color)
for (y = 0; y < surface_desc.dwHeight; ++y)
{
ptr = (DWORD *)((BYTE *)surface_desc.lpSurface + y * U1(surface_desc).lPitch);
ptr = (DWORD *)((BYTE *)surface_desc.lpSurface + y * surface_desc.lPitch);
for (x = 0; x < surface_desc.dwWidth; ++x)
{
ptr[x] = color;
......@@ -448,8 +448,8 @@ static void emit_set_ts(void **ptr, D3DTRANSFORMSTATETYPE state, DWORD value)
inst->bSize = sizeof(*ts);
inst->wCount = 1;
U1(*ts).dtstTransformStateType = state;
U2(*ts).dwArg[0] = value;
ts->dtstTransformStateType = state;
ts->dwArg[0] = value;
*ptr = ts + 1;
}
......@@ -463,8 +463,8 @@ static void emit_set_ls(void **ptr, D3DLIGHTSTATETYPE state, DWORD value)
inst->bSize = sizeof(*ls);
inst->wCount = 1;
U1(*ls).dlstLightStateType = state;
U2(*ls).dwArg[0] = value;
ls->dlstLightStateType = state;
ls->dwArg[0] = value;
*ptr = ls + 1;
}
......@@ -478,8 +478,8 @@ static void emit_set_rs(void **ptr, D3DRENDERSTATETYPE state, DWORD value)
inst->bSize = sizeof(*rs);
inst->wCount = 1;
U1(*rs).drstRenderStateType = state;
U2(*rs).dwArg[0] = value;
rs->drstRenderStateType = state;
rs->dwArg[0] = value;
*ptr = rs + 1;
}
......@@ -493,15 +493,15 @@ static void emit_tquad(void **ptr, WORD base_idx)
inst->bSize = sizeof(*tri);
inst->wCount = 2;
U1(*tri).v1 = base_idx;
U2(*tri).v2 = base_idx + 1;
U3(*tri).v3 = base_idx + 2;
tri->v1 = base_idx;
tri->v2 = base_idx + 1;
tri->v3 = base_idx + 2;
tri->wFlags = D3DTRIFLAG_START;
++tri;
U1(*tri).v1 = base_idx + 2;
U2(*tri).v2 = base_idx + 1;
U3(*tri).v3 = base_idx + 3;
tri->v1 = base_idx + 2;
tri->v2 = base_idx + 1;
tri->v3 = base_idx + 3;
tri->wFlags = D3DTRIFLAG_ODD;
++tri;
......@@ -517,15 +517,15 @@ static void emit_tquad_tlist(void **ptr, WORD base_idx)
inst->bSize = sizeof(*tri);
inst->wCount = 2;
U1(*tri).v1 = base_idx;
U2(*tri).v2 = base_idx + 1;
U3(*tri).v3 = base_idx + 2;
tri->v1 = base_idx;
tri->v2 = base_idx + 1;
tri->v3 = base_idx + 2;
tri->wFlags = D3DTRIFLAG_START;
++tri;
U1(*tri).v1 = base_idx + 2;
U2(*tri).v2 = base_idx + 3;
U3(*tri).v3 = base_idx;
tri->v1 = base_idx + 2;
tri->v2 = base_idx + 3;
tri->v3 = base_idx;
tri->wFlags = D3DTRIFLAG_START;
++tri;
......@@ -544,9 +544,9 @@ static void emit_tri_indices(void **ptr, WORD *indices, unsigned int primitive_c
for (i = 0; i < primitive_count; ++i)
{
U1(*tri).v1 = indices[i * 3];
U2(*tri).v2 = indices[i * 3 + 1];
U3(*tri).v3 = indices[i * 3 + 2];
tri->v1 = indices[i * 3];
tri->v2 = indices[i * 3 + 1];
tri->v3 = indices[i * 3 + 2];
tri->wFlags = D3DTRIFLAG_START;
++tri;
}
......@@ -616,7 +616,7 @@ static DWORD get_device_z_depth(IDirect3DDevice *device)
if (FAILED(hr))
return 0;
return U2(desc).dwZBufferBitDepth;
return desc.dwZBufferBitDepth;
}
static IDirectDraw *create_ddraw(void)
......@@ -681,7 +681,7 @@ static IDirect3DDevice *create_device_ex(IDirectDraw *ddraw, HWND window, DWORD
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
if (is_software_device_type(device_guid))
surface_desc.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
U2(surface_desc).dwZBufferBitDepth = z_depths[i];
surface_desc.dwZBufferBitDepth = z_depths[i];
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if (FAILED(IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL)))
......@@ -784,10 +784,10 @@ static IDirect3DMaterial *create_diffuse_material(IDirect3DDevice *device, float
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U(mat).diffuse).r = r;
U2(U(mat).diffuse).g = g;
U3(U(mat).diffuse).b = b;
U4(U(mat).diffuse).a = a;
mat.diffuse.r = r;
mat.diffuse.g = g;
mat.diffuse.b = b;
mat.diffuse.a = a;
return create_material(device, &mat);
}
......@@ -799,15 +799,15 @@ static IDirect3DMaterial *create_diffuse_and_ambient_material(IDirect3DDevice *d
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U(mat).diffuse).r = r;
U2(U(mat).diffuse).g = g;
U3(U(mat).diffuse).b = b;
U4(U(mat).diffuse).a = a;
mat.diffuse.r = r;
mat.diffuse.g = g;
mat.diffuse.b = b;
mat.diffuse.a = a;
U1(U(mat).ambient).r = r;
U2(U(mat).ambient).g = g;
U3(U(mat).ambient).b = b;
U4(U(mat).ambient).a = a;
mat.ambient.r = r;
mat.ambient.g = g;
mat.ambient.b = b;
mat.ambient.a = a;
return create_material(device, &mat);
}
......@@ -818,10 +818,10 @@ static IDirect3DMaterial *create_emissive_material(IDirect3DDevice *device, floa
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U3(mat).emissive).r = r;
U2(U3(mat).emissive).g = g;
U3(U3(mat).emissive).b = b;
U4(U3(mat).emissive).a = a;
mat.emissive.r = r;
mat.emissive.g = g;
mat.emissive.b = b;
mat.emissive.a = a;
return create_material(device, &mat);
}
......@@ -833,11 +833,11 @@ static IDirect3DMaterial *create_specular_material(IDirect3DDevice *device,
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U2(mat).specular).r = r;
U2(U2(mat).specular).g = g;
U3(U2(mat).specular).b = b;
U4(U2(mat).specular).a = a;
U4(mat).power = power;
mat.specular.r = r;
mat.specular.g = g;
mat.specular.b = b;
mat.specular.a = a;
mat.power = power;
return create_material(device, &mat);
}
......@@ -1112,10 +1112,10 @@ static void test_clipper_blt(void)
surface_desc.dwHeight = 480;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &src_surface, NULL);
ok(SUCCEEDED(hr), "Failed to create source surface, hr %#lx.\n", hr);
......@@ -1131,7 +1131,7 @@ static void test_clipper_blt(void)
hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, DDLOCK_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#lx.\n", hr);
ok(U1(surface_desc).lPitch == 2560, "Got unexpected surface pitch %lu.\n", U1(surface_desc).lPitch);
ok(surface_desc.lPitch == 2560, "Got unexpected surface pitch %lu.\n", surface_desc.lPitch);
ptr = surface_desc.lpSurface;
memcpy(&ptr[ 0], &src_data[ 0], 6 * sizeof(DWORD));
memcpy(&ptr[ 640], &src_data[ 6], 6 * sizeof(DWORD));
......@@ -1158,7 +1158,7 @@ static void test_clipper_blt(void)
}
}
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#lx.\n", hr);
for (i = 0; i < 4; ++i)
......@@ -1259,10 +1259,10 @@ static void test_coop_level_d3d_state(void)
memset(&material, 0, sizeof(material));
material.dwSize = sizeof(material);
U1(U(material).diffuse).r = 0.0f;
U2(U(material).diffuse).g = 1.0f;
U3(U(material).diffuse).b = 0.0f;
U4(U(material).diffuse).a = 1.0f;
material.diffuse.r = 0.0f;
material.diffuse.g = 1.0f;
material.diffuse.b = 0.0f;
material.diffuse.a = 1.0f;
hr = IDirect3DMaterial_SetMaterial(background, &material);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -1336,7 +1336,7 @@ static void test_surface_interface_mismatch(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = z_depth;
surface_desc.dwZBufferBitDepth = z_depth;
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
......@@ -1815,11 +1815,11 @@ static void test_ck_rgba(const GUID *device_guid)
surface_desc.dwHeight = 256;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0xff00ff00;
surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0xff00ff00;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
......@@ -1878,7 +1878,7 @@ static void test_ck_rgba(const GUID *device_guid)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = tests[i].fill_color;
fx.dwFillColor = tests[i].fill_color;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -1902,7 +1902,7 @@ static void test_ck_rgba(const GUID *device_guid)
|| broken(compare_color(color, tests[i].result1_warp, 1)),
"Got unexpected color 0x%08x for test %u.\n", color, i);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -1989,10 +1989,10 @@ static void test_ck_default(void)
surface_desc.dwHeight = 256;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x000000ff;
surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x000000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
......@@ -2005,7 +2005,7 @@ static void test_ck_default(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0x000000ff;
fx.dwFillColor = 0x000000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr);
......@@ -2809,7 +2809,7 @@ static void test_redundant_mode_set(void)
ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr);
hr = IDirectDraw_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight,
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
surface_desc.ddpfPixelFormat.dwRGBBitCount);
ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#lx.\n", hr);
GetWindowRect(window, &q);
......@@ -2821,7 +2821,7 @@ static void test_redundant_mode_set(void)
ok(EqualRect(&r, &s), "Expected %s, got %s.\n", wine_dbgstr_rect(&r), wine_dbgstr_rect(&s));
hr = IDirectDraw_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight,
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
surface_desc.ddpfPixelFormat.dwRGBBitCount);
ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#lx.\n", hr);
GetWindowRect(window, &s);
......@@ -2856,7 +2856,7 @@ static HRESULT CALLBACK test_coop_level_mode_set_enum_cb(DDSURFACEDESC *surface_
{
struct test_coop_level_mode_set_enum_param *param = context;
if (U1(surface_desc->ddpfPixelFormat).dwRGBBitCount != registry_mode.dmBitsPerPel)
if (surface_desc->ddpfPixelFormat.dwRGBBitCount != registry_mode.dmBitsPerPel)
return DDENUMRET_OK;
if (surface_desc->dwWidth == registry_mode.dmPelsWidth
&& surface_desc->dwHeight == registry_mode.dmPelsHeight)
......@@ -4720,7 +4720,7 @@ static void test_rt_caps(const GUID *device_guid)
if (caps_in & DDSCAPS_ZBUFFER)
{
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(surface_desc).dwZBufferBitDepth = z_depth;
surface_desc.dwZBufferBitDepth = z_depth;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
......@@ -5016,7 +5016,7 @@ static void test_surface_lock(void)
if (tests[i].caps & DDSCAPS_ZBUFFER)
{
ddsd.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(ddsd).dwZBufferBitDepth = z_depth;
ddsd.dwZBufferBitDepth = z_depth;
}
ddsd.ddsCaps.dwCaps = tests[i].caps;
......@@ -5408,10 +5408,10 @@ static void test_sysmem_overlay(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OVERLAY;
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(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_NOOVERLAYHW, "Got unexpected hr %#lx.\n", hr);
......@@ -5533,8 +5533,8 @@ static void test_primary_palette(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth);
ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 8, "Got unexpected bit count %lu.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 8, "Got unexpected bit count %lu.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount);
hr = set_display_mode(ddraw, 640, 480);
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr);
......@@ -5545,9 +5545,9 @@ static void test_primary_palette(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth);
ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 32
|| U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 32
|| surface_desc.ddpfPixelFormat.dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", surface_desc.ddpfPixelFormat.dwRGBBitCount);
hr = IDirectDrawSurface_IsLost(primary);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr);
......@@ -5562,9 +5562,9 @@ static void test_primary_palette(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth);
ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 32
|| U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 32
|| surface_desc.ddpfPixelFormat.dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", surface_desc.ddpfPixelFormat.dwRGBBitCount);
done:
refcount = IDirectDrawSurface_Release(backbuffer);
......@@ -5607,7 +5607,7 @@ static void test_surface_attachment(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
U2(surface_desc).dwMipMapCount = 3;
surface_desc.dwMipMapCount = 3;
surface_desc.dwWidth = 128;
surface_desc.dwHeight = 128;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
......@@ -5775,8 +5775,8 @@ static void test_surface_attachment(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
surface_desc.ddpfPixelFormat.dwZBufferBitDepth = 16;
surface_desc.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
surface_desc.dwWidth = 32;
surface_desc.dwHeight = 32;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface2, NULL);
......@@ -5815,10 +5815,10 @@ static void test_surface_attachment(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; /* D3DFMT_R5G6B5 */
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 16;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xf800;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x07e0;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x001f;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 16;
surface_desc.ddpfPixelFormat.dwRBitMask = 0xf800;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x07e0;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x001f;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface3, NULL);
......@@ -5826,8 +5826,8 @@ static void test_surface_attachment(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
surface_desc.ddpfPixelFormat.dwZBufferBitDepth = 16;
surface_desc.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface2, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -6182,13 +6182,13 @@ static void test_create_surface_pitch(void)
surface_desc.ddsCaps.dwCaps = test_data[i].caps;
surface_desc.dwWidth = 63;
surface_desc.dwHeight = 63;
U1(surface_desc).lPitch = test_data[i].pitch_in;
surface_desc.lPitch = test_data[i].pitch_in;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
if (test_data[i].flags_in & DDSD_LPSURFACE)
{
......@@ -6213,13 +6213,13 @@ static void test_create_surface_pitch(void)
if (!(test_data[i].caps & DDSCAPS_TEXTURE))
{
if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64)
todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64,
todo_wine ok(surface_desc.lPitch == test_data[i].pitch_out64,
"Test %u: Got unexpected pitch %#lx, expected %#lx.\n",
i, U1(surface_desc).lPitch, test_data[i].pitch_out64);
i, surface_desc.lPitch, test_data[i].pitch_out64);
else
ok(U1(surface_desc).lPitch == test_data[i].pitch_out32,
ok(surface_desc.lPitch == test_data[i].pitch_out32,
"Test %u: Got unexpected pitch %#lx, expected %#lx.\n",
i, U1(surface_desc).lPitch, test_data[i].pitch_out32);
i, surface_desc.lPitch, test_data[i].pitch_out32);
}
ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface);
......@@ -6324,7 +6324,7 @@ static void test_mipmap(void)
surface_desc.dwWidth = tests[i].width;
surface_desc.dwHeight = tests[i].height;
if (tests[i].flags & DDSD_MIPMAPCOUNT)
U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in;
surface_desc.dwMipMapCount = tests[i].mipmap_count_in;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
if (FAILED(hr))
......@@ -6336,12 +6336,12 @@ static void test_mipmap(void)
ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", i, hr);
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
"Test %u: Got unexpected flags %#lx.\n", i, surface_desc.dwFlags);
ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out,
"Test %u: Got unexpected mipmap count %lu.\n", i, U2(surface_desc).dwMipMapCount);
ok(surface_desc.dwMipMapCount == tests[i].mipmap_count_out,
"Test %u: Got unexpected mipmap count %lu.\n", i, surface_desc.dwMipMapCount);
surface_base = surface;
IDirectDrawSurface2_AddRef(surface_base);
mipmap_count = U2(surface_desc).dwMipMapCount;
mipmap_count = surface_desc.dwMipMapCount;
while (mipmap_count > 1)
{
hr = IDirectDrawSurface_GetAttachedSurface(surface_base, &caps, &surface_mip);
......@@ -6353,9 +6353,9 @@ static void test_mipmap(void)
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#lx.\n", i, mipmap_count, hr);
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
"Test %u, %u: Got unexpected flags %#lx.\n", i, mipmap_count, surface_desc.dwFlags);
ok(U2(surface_desc).dwMipMapCount == mipmap_count,
ok(surface_desc.dwMipMapCount == mipmap_count,
"Test %u, %u: Got unexpected mipmap count %lu.\n",
i, mipmap_count, U2(surface_desc).dwMipMapCount);
i, mipmap_count, surface_desc.dwMipMapCount);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -6430,7 +6430,7 @@ static void test_palette_complex(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -6558,7 +6558,7 @@ static void test_p8_blit(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &src, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst_p8, NULL);
......@@ -6574,11 +6574,11 @@ static void test_p8_blit(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -7069,11 +7069,11 @@ static void test_lighting(void)
memset(&light_desc, 0, sizeof(light_desc));
light_desc.dwSize = sizeof(light_desc);
light_desc.dltType = D3DLIGHT_DIRECTIONAL;
U1(light_desc.dcvColor).r = 0.0f;
U2(light_desc.dcvColor).g = 0.25f;
U3(light_desc.dcvColor).b = 1.0f;
U4(light_desc.dcvColor).a = 1.0f;
U3(light_desc.dvDirection).z = 1.0f;
light_desc.dcvColor.r = 0.0f;
light_desc.dcvColor.g = 0.25f;
light_desc.dcvColor.b = 1.0f;
light_desc.dcvColor.a = 1.0f;
light_desc.dvDirection.z = 1.0f;
hr = IDirect3DLight_SetLight(light, &light_desc);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport_AddLight(viewport, light);
......@@ -7361,14 +7361,14 @@ static void test_specular_lighting(void)
{
for (x = 0; x < vertices_side; ++x)
{
U1(quad[i]).x = x * 2.0f / (vertices_side - 1) - 1.0f;
U2(quad[i]).y = y * 2.0f / (vertices_side - 1) - 1.0f;
U3(quad[i]).z = 1.0f;
U4(quad[i]).nx = 0.0f;
U5(quad[i]).ny = 0.0f;
U6(quad[i]).nz = -1.0f;
U7(quad[i]).tu = 0.0f;
U8(quad[i++]).tv = 0.0f;
quad[i].x = x * 2.0f / (vertices_side - 1) - 1.0f;
quad[i].y = y * 2.0f / (vertices_side - 1) - 1.0f;
quad[i].z = 1.0f;
quad[i].nx = 0.0f;
quad[i].ny = 0.0f;
quad[i].nz = -1.0f;
quad[i].tu = 0.0f;
quad[i++].tv = 0.0f;
}
}
for (i = 0, y = 0; y < (vertices_side - 1); ++y)
......@@ -7556,7 +7556,7 @@ static void test_palette_gdi(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -7682,12 +7682,12 @@ static void test_palette_gdi(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 3;
fx.dwFillColor = 3;
SetRect(&r, 0, 0, 319, 479);
hr = IDirectDrawSurface_Blt(primary, &r, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear surface, hr %#lx.\n", hr);
SetRect(&r, 320, 0, 639, 479);
U5(fx).dwFillColor = 4;
fx.dwFillColor = 4;
hr = IDirectDrawSurface_Blt(primary, &r, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear surface, hr %#lx.\n", hr);
......@@ -7954,10 +7954,10 @@ static void test_palette_alpha(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDrawSurface_SetPalette(surface, palette);
......@@ -8022,10 +8022,10 @@ static void test_lost_device(void)
surface_desc.dwHeight = 64;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
if (FAILED(IDirectDraw_CreateSurface(ddraw, &surface_desc, &vidmem_surface, NULL)))
{
skip("Failed to create video memory surface, skipping related tests.\n");
......@@ -8193,7 +8193,7 @@ static void test_lost_device(void)
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = 16;
surface_desc.dwZBufferBitDepth = 16;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
if (FAILED(hr))
{
......@@ -8470,11 +8470,11 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000ff;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -8488,10 +8488,10 @@ static void test_texturemapblend(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x800000ff;
fx.dwFillColor = 0x800000ff;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -8582,10 +8582,10 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
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(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -8598,10 +8598,10 @@ static void test_texturemapblend(void)
hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x800000ff;
fx.dwFillColor = 0x800000ff;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -8662,11 +8662,11 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000ff;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -8678,10 +8678,10 @@ static void test_texturemapblend(void)
hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x00ffffff;
fx.dwFillColor = 0x00ffffff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x00ffff80;
fx.dwFillColor = 0x00ffff80;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -8744,10 +8744,10 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
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;
hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -8760,10 +8760,10 @@ static void test_texturemapblend(void)
hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0xf800;
fx.dwFillColor = 0xf800;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x001f;
fx.dwFillColor = 0x001f;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -9107,7 +9107,7 @@ static void test_color_fill(void)
/* Some Windows drivers modify dwFillColor when it is used on P8 or FourCC formats. */
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xdeadbeef;
fx.dwFillColor = 0xdeadbeef;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -9137,8 +9137,8 @@ static void test_color_fill(void)
{
surface_desc.dwFlags &= ~DDSD_PIXELFORMAT;
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(surface_desc).dwZBufferBitDepth = get_device_z_depth(device);
mask >>= (32 - U2(surface_desc).dwZBufferBitDepth);
surface_desc.dwZBufferBitDepth = get_device_z_depth(device);
mask >>= (32 - surface_desc.dwZBufferBitDepth);
/* Some drivers seem to convert depth values incorrectly or not at
* all. Affects at least AMD PALM, 8.17.10.1247. */
if (tests[i].caps & DDSCAPS_VIDEOMEMORY)
......@@ -9195,7 +9195,7 @@ static void test_color_fill(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_READONLY, 0);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, surface %s.\n", hr, tests[i].name);
color = surface_desc.lpSurface;
todo_wine_if(tests[i].caps & DDSCAPS_VIDEOMEMORY && U2(surface_desc).dwZBufferBitDepth != 16)
todo_wine_if(tests[i].caps & DDSCAPS_VIDEOMEMORY && surface_desc.dwZBufferBitDepth != 16)
ok((*color & mask) == (tests[i].result & mask) || broken((*color & mask) == (expected_broken & mask))
|| broken(is_warp && (*color & mask) == (~0u & mask)) /* Windows 8+ testbot. */,
"Got clear result 0x%08x, expected 0x%08x, surface %s.\n",
......@@ -9204,13 +9204,13 @@ static void test_color_fill(void)
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, surface %s.\n", hr, tests[i].name);
}
U5(fx).dwFillColor = 0xdeadbeef;
fx.dwFillColor = 0xdeadbeef;
fx.dwROP = BLACKNESS;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_ROP | DDBLT_WAIT, &fx);
ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#lx, expected %s, surface %s.\n",
hr, tests[i].rop_success ? "success" : "failure", tests[i].name);
ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
U5(fx).dwFillColor, tests[i].name);
ok(fx.dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
fx.dwFillColor, tests[i].name);
if (SUCCEEDED(hr) && tests[i].check_result)
{
......@@ -9229,8 +9229,8 @@ static void test_color_fill(void)
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_ROP | DDBLT_WAIT, &fx);
ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#lx, expected %s, surface %s.\n",
hr, tests[i].rop_success ? "success" : "failure", tests[i].name);
ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
U5(fx).dwFillColor, tests[i].name);
ok(fx.dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
fx.dwFillColor, tests[i].name);
if (SUCCEEDED(hr) && tests[i].check_result)
{
......@@ -9251,7 +9251,7 @@ static void test_color_fill(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xdeadbeef;
fx.dwFillColor = 0xdeadbeef;
fx.dwROP = WHITENESS;
memset(&surface_desc, 0, sizeof(surface_desc));
......@@ -9261,10 +9261,10 @@ static void test_color_fill(void)
surface_desc.dwHeight = 64;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -9349,7 +9349,7 @@ static void test_color_fill(void)
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_ZBUFFERBITDEPTH;
surface_desc.dwWidth = 64;
surface_desc.dwHeight = 64;
U2(surface_desc).dwZBufferBitDepth = get_device_z_depth(device);
surface_desc.dwZBufferBitDepth = get_device_z_depth(device);
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -9543,12 +9543,12 @@ static void test_colorkey_precision(void)
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
U5(fx).dwFillColor = tests[t].clear;
fx.dwFillColor = tests[t].clear;
/* On the w8 testbot (WARP driver) the blit result has different values in the
* X channel. */
color_mask = U2(tests[t].fmt).dwRBitMask
| U3(tests[t].fmt).dwGBitMask
| U4(tests[t].fmt).dwBBitMask;
color_mask = tests[t].fmt.dwRBitMask
| tests[t].fmt.dwGBitMask
| tests[t].fmt.dwBBitMask;
for (c = 0; c <= tests[t].max; ++c)
{
......@@ -9766,11 +9766,11 @@ static void test_range_colorkey(void)
surface_desc.dwWidth = 1;
surface_desc.dwHeight = 1;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0x00000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0x00000000;
/* Creating a surface with a range color key fails with DDERR_NOCOLORKEY. */
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000;
......@@ -10064,10 +10064,10 @@ static void test_lockrect_invalid(void)
surface_desc.dwHeight = 128;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x00ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0xff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x00ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x0000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, type %s.\n", hr, resources[r].name);
......@@ -10174,24 +10174,24 @@ static void test_yv12_overlay(void)
ok(desc.dwWidth == 256, "Got unexpected width %lu.\n", desc.dwWidth);
ok(desc.dwHeight == 256, "Got unexpected height %lu.\n", desc.dwHeight);
/* The overlay pitch seems to have 256 byte alignment. */
ok(!(U1(desc).lPitch & 0xff), "Got unexpected pitch %lu.\n", U1(desc).lPitch);
ok(!(desc.lPitch & 0xff), "Got unexpected pitch %lu.\n", desc.lPitch);
/* Fill the surface with some data for the blit test. */
base = desc.lpSurface;
/* Luminance */
for (y = 0; y < desc.dwHeight; ++y)
{
memset(base + U1(desc).lPitch * y, 0x10, desc.dwWidth);
memset(base + desc.lPitch * y, 0x10, desc.dwWidth);
}
/* V */
for (; y < desc.dwHeight + desc.dwHeight / 4; ++y)
{
memset(base + U1(desc).lPitch * y, 0x20, desc.dwWidth);
memset(base + desc.lPitch * y, 0x20, desc.dwWidth);
}
/* U */
for (; y < desc.dwHeight + desc.dwHeight / 2; ++y)
{
memset(base + U1(desc).lPitch * y, 0x30, desc.dwWidth);
memset(base + desc.lPitch * y, 0x30, desc.dwWidth);
}
hr = IDirectDrawSurface_Unlock(src_surface, NULL);
......@@ -10205,8 +10205,8 @@ static void test_yv12_overlay(void)
hr = IDirectDrawSurface_Lock(src_surface, &rect, &desc, DDLOCK_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr);
offset = ((const unsigned char *)desc.lpSurface - base);
ok(offset == rect.top * U1(desc).lPitch + rect.left, "Got unexpected offset %u, expected %lu.\n",
offset, rect.top * U1(desc).lPitch + rect.left);
ok(offset == rect.top * desc.lPitch + rect.left, "Got unexpected offset %u, expected %lu.\n",
offset, rect.top * desc.lPitch + rect.left);
hr = IDirectDrawSurface_Unlock(src_surface, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr);
......@@ -10233,9 +10233,9 @@ static void test_yv12_overlay(void)
base = desc.lpSurface;
ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]);
base += desc.dwHeight * U1(desc).lPitch;
base += desc.dwHeight * desc.lPitch;
ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
base += desc.dwHeight / 4 * U1(desc).lPitch;
base += desc.dwHeight / 4 * desc.lPitch;
ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
hr = IDirectDrawSurface_Unlock(dst_surface, NULL);
......@@ -10314,10 +10314,10 @@ static void test_offscreen_overlay(void)
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
surface_desc.ddpfPixelFormat.dwFourCC = 0;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 16;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xf800;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x07e0;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x001f;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 16;
surface_desc.ddpfPixelFormat.dwRBitMask = 0xf800;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x07e0;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x001f;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &offscreen, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr);
......@@ -10568,11 +10568,11 @@ static void test_blt_z_alpha(void)
memset(&pf, 0, sizeof(pf));
pf.dwSize = sizeof(pf);
pf.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(pf).dwRGBBitCount = 32;
U2(pf).dwRBitMask = 0x00ff0000;
U3(pf).dwGBitMask = 0x0000ff00;
U4(pf).dwBBitMask = 0x000000ff;
U5(pf).dwRGBAlphaBitMask = 0xff000000;
pf.dwRGBBitCount = 32;
pf.dwRBitMask = 0x00ff0000;
pf.dwGBitMask = 0x0000ff00;
pf.dwBBitMask = 0x000000ff;
pf.dwRGBAlphaBitMask = 0xff000000;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -10591,23 +10591,23 @@ static void test_blt_z_alpha(void)
fx.dwSize = sizeof(fx);
fx.dwZBufferOpCode = D3DCMP_NEVER;
fx.dwZDestConstBitDepth = 32;
U1(fx).dwZDestConst = 0x11111111;
fx.dwZDestConst = 0x11111111;
fx.dwZSrcConstBitDepth = 32;
U2(fx).dwZSrcConst = 0xeeeeeeee;
fx.dwZSrcConst = 0xeeeeeeee;
fx.dwAlphaEdgeBlendBitDepth = 8;
fx.dwAlphaEdgeBlend = 0x7f;
fx.dwAlphaDestConstBitDepth = 8;
U3(fx).dwAlphaDestConst = 0xdd;
fx.dwAlphaDestConst = 0xdd;
fx.dwAlphaSrcConstBitDepth = 8;
U4(fx).dwAlphaSrcConst = 0x22;
fx.dwAlphaSrcConst = 0x22;
for (i = 0; i < ARRAY_SIZE(blt_flags); ++i)
{
U5(fx).dwFillColor = 0x3300ff00;
fx.dwFillColor = 0x3300ff00;
hr = IDirectDrawSurface_Blt(src_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr);
U5(fx).dwFillColor = 0xccff0000;
fx.dwFillColor = 0xccff0000;
hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr);
......@@ -10685,16 +10685,16 @@ static void test_cross_device_blt(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 16;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00007c00;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x000003e0;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000001f;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 16;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00007c00;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x000003e0;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x0000001f;
hr = IDirectDraw_CreateSurface(ddraw2, &surface_desc, &surface2, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface2, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr);
......@@ -10825,7 +10825,7 @@ static void test_getdc(void)
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDraw_GetDisplayMode(ddraw, &surface_desc);
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr);
screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount;
screen_bpp = surface_desc.ddpfPixelFormat.dwRGBBitCount;
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
{
......@@ -10877,12 +10877,12 @@ static void test_getdc(void)
dib.dsBm.bmWidth, test_data[i].name);
ok(dib.dsBm.bmHeight == surface_desc.dwHeight, "Got unexpected height %d for format %s.\n",
dib.dsBm.bmHeight, test_data[i].name);
width_bytes = ((dib.dsBm.bmWidth * U1(test_data[i].format).dwRGBBitCount + 31) >> 3) & ~3;
width_bytes = ((dib.dsBm.bmWidth * test_data[i].format.dwRGBBitCount + 31) >> 3) & ~3;
ok(dib.dsBm.bmWidthBytes == width_bytes, "Got unexpected width bytes %d for format %s.\n",
dib.dsBm.bmWidthBytes, test_data[i].name);
ok(dib.dsBm.bmPlanes == 1, "Got unexpected plane count %d for format %s.\n",
dib.dsBm.bmPlanes, test_data[i].name);
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
ok(dib.dsBm.bmBitsPixel == test_data[i].format.dwRGBBitCount,
"Got unexpected bit count %d for format %s.\n",
dib.dsBm.bmBitsPixel, test_data[i].name);
/* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I
......@@ -10899,11 +10899,11 @@ static void test_getdc(void)
dib.dsBmih.biHeight, test_data[i].name);
ok(dib.dsBmih.biPlanes == 1, "Got unexpected plane count %u for format %s.\n",
dib.dsBmih.biPlanes, test_data[i].name);
ok(dib.dsBmih.biBitCount == U1(test_data[i].format).dwRGBBitCount,
ok(dib.dsBmih.biBitCount == test_data[i].format.dwRGBBitCount,
"Got unexpected bit count %u for format %s.\n",
dib.dsBmih.biBitCount, test_data[i].name);
ok(dib.dsBmih.biCompression == (U1(test_data[i].format).dwRGBBitCount == 16 ? BI_BITFIELDS : BI_RGB)
|| broken(U1(test_data[i].format).dwRGBBitCount == 32 && dib.dsBmih.biCompression == BI_BITFIELDS),
ok(dib.dsBmih.biCompression == (test_data[i].format.dwRGBBitCount == 16 ? BI_BITFIELDS : BI_RGB)
|| broken(test_data[i].format.dwRGBBitCount == 32 && dib.dsBmih.biCompression == BI_BITFIELDS),
"Got unexpected compression %#lx for format %s.\n",
dib.dsBmih.biCompression, test_data[i].name);
ok(!dib.dsBmih.biSizeImage, "Got unexpected image size %lu for format %s.\n",
......@@ -10919,9 +10919,9 @@ static void test_getdc(void)
if (dib.dsBmih.biCompression == BI_BITFIELDS)
{
ok((dib.dsBitfields[0] == U2(test_data[i].format).dwRBitMask
&& dib.dsBitfields[1] == U3(test_data[i].format).dwGBitMask
&& dib.dsBitfields[2] == U4(test_data[i].format).dwBBitMask)
ok((dib.dsBitfields[0] == test_data[i].format.dwRBitMask
&& dib.dsBitfields[1] == test_data[i].format.dwGBitMask
&& dib.dsBitfields[2] == test_data[i].format.dwBBitMask)
|| broken(!dib.dsBitfields[0] && !dib.dsBitfields[1] && !dib.dsBitfields[2]),
"Got unexpected colour masks 0x%08lx 0x%08lx 0x%08lx for format %s.\n",
dib.dsBitfields[0], dib.dsBitfields[1], dib.dsBitfields[2], test_data[i].name);
......@@ -11313,12 +11313,12 @@ static void test_transform_vertices(void)
{D3DCLIP_FRONT, {-1.0f}, {-1.0f}, {-1.0f}}, {0, { 0.5f}, { 0.5f}, {0.5f}},
{D3DCLIP_FRONT, {-0.5f}, {-0.5f}, {-0.5f}}, {0, {-0.5f}, {-0.5f}, {0.0f}}
};
ok(compare_float(U1(cmp_h[i]).hx, U1(out_h[i]).hx, 4096)
&& compare_float(U2(cmp_h[i]).hy, U2(out_h[i]).hy, 4096)
&& compare_float(U3(cmp_h[i]).hz, U3(out_h[i]).hz, 4096)
ok(compare_float(cmp_h[i].hx, out_h[i].hx, 4096)
&& compare_float(cmp_h[i].hy, out_h[i].hy, 4096)
&& compare_float(cmp_h[i].hz, out_h[i].hz, 4096)
&& cmp_h[i].dwFlags == out_h[i].dwFlags,
"HVertex %u differs. Got %#lx %.8e %.8e %.8e.\n", i,
out_h[i].dwFlags, U1(out_h[i]).hx, U2(out_h[i]).hy, U3(out_h[i]).hz);
out_h[i].dwFlags, out_h[i].hx, out_h[i].hy, out_h[i].hz);
/* No scheme has been found behind those return values. It seems to be
* whatever data windows has when throwing the vertex away. Modify the
......@@ -11722,8 +11722,8 @@ static void test_display_mode_surface_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == width, "Got width %lu, expected %u.\n", surface_desc.dwWidth, width);
ok(surface_desc.dwHeight == height, "Got height %lu, expected %u.\n", surface_desc.dwHeight, height);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount, bpp);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -11738,8 +11738,8 @@ static void test_display_mode_surface_pixel_format(void)
ok(surface_desc.dwHeight == height, "Got height %lu, expected %u.\n", surface_desc.dwHeight, height);
ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n",
surface_desc.ddpfPixelFormat.dwFlags);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount, bpp);
IDirectDrawSurface_Release(surface);
memset(&surface_desc, 0, sizeof(surface_desc));
......@@ -11754,8 +11754,8 @@ static void test_display_mode_surface_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n",
surface_desc.ddpfPixelFormat.dwFlags);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount, bpp);
IDirectDrawSurface_Release(surface);
refcount = IDirectDraw_Release(ddraw);
......@@ -11998,10 +11998,10 @@ static void test_texture_load(void)
surface_desc.dwHeight = 256;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &src_surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -12021,7 +12021,7 @@ static void test_texture_load(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0x0000ffff;
fx.dwFillColor = 0x0000ffff;
hr = IDirectDrawSurface_Blt(src_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr);
......@@ -12056,7 +12056,7 @@ static void test_texture_load(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0x000000ff;
fx.dwFillColor = 0x000000ff;
hr = IDirectDrawSurface_Blt(src_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr);
......@@ -12112,10 +12112,10 @@ static void test_ck_operation(void)
surface_desc.dwHeight = 1;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -12251,11 +12251,11 @@ static void test_ck_operation(void)
surface_desc.dwHeight = 1;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &src, NULL);
......@@ -12670,7 +12670,7 @@ static void test_depth_readback(void)
for (x = 80; x < 640; x += 160)
{
ptr = (BYTE *)surface_desc.lpSurface
+ y * U1(surface_desc).lPitch
+ y * surface_desc.lPitch
+ x * (z_depth == 16 ? 2 : 4);
depth = *((DWORD *)ptr) & z_mask;
expected_depth = (x * (0.9 / 640.0) + y * (0.1 / 480.0)) * z_mask;
......@@ -12734,16 +12734,16 @@ static void test_clear(void)
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
/* Positive x, negative y. */
U1(rect[0]).x1 = 0;
U2(rect[0]).y1 = 480;
U3(rect[0]).x2 = 320;
U4(rect[0]).y2 = 240;
rect[0].x1 = 0;
rect[0].y1 = 480;
rect[0].x2 = 320;
rect[0].y2 = 240;
/* Positive x, positive y. */
U1(rect[1]).x1 = 0;
U2(rect[1]).y1 = 0;
U3(rect[1]).x2 = 320;
U4(rect[1]).y2 = 240;
rect[1].x1 = 0;
rect[1].y1 = 0;
rect[1].x2 = 320;
rect[1].y2 = 240;
/* Clear 2 rectangles with one call. Unlike d3d8/9, the refrast does not
* refuse negative rectangles, but it will not clear them either. */
......@@ -12766,10 +12766,10 @@ static void test_clear(void)
/* negative x, negative y.
* Also ignored, except on WARP, which clears the entire screen. */
U1(rect_negneg).x1 = 640;
U2(rect_negneg).y1 = 240;
U3(rect_negneg).x2 = 320;
U4(rect_negneg).y2 = 0;
rect_negneg.x1 = 640;
rect_negneg.y1 = 240;
rect_negneg.x2 = 320;
rect_negneg.y2 = 0;
viewport_set_background(device, viewport, green);
hr = IDirect3DViewport_Clear(viewport, 1, &rect_negneg, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
......@@ -12804,10 +12804,10 @@ static void test_clear(void)
viewport3 = create_viewport(device, 320, 240, 320, 240);
viewport_set_background(device, viewport3, green);
U1(rect[0]).x1 = 160;
U2(rect[0]).y1 = 120;
U3(rect[0]).x2 = 480;
U4(rect[0]).y2 = 360;
rect[0].x1 = 160;
rect[0].y1 = 120;
rect[0].x2 = 480;
rect[0].y2 = 360;
hr = IDirect3DViewport_Clear(viewport3, 1, &rect[0], D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
......@@ -12865,10 +12865,10 @@ static void test_clear(void)
* viewport. */
hr = IDirect3DViewport_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
U1(rect[0]).x1 = 330;
U2(rect[0]).y1 = 250;
U3(rect[0]).x2 = 340;
U4(rect[0]).y2 = 260;
rect[0].x1 = 330;
rect[0].y1 = 250;
rect[0].x2 = 340;
rect[0].y2 = 260;
hr = IDirect3DViewport_Clear(viewport3, 1, &rect[0], D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
......@@ -12986,7 +12986,7 @@ static HRESULT WINAPI enum_surfaces_create_cb(IDirectDrawSurface *surface, DDSUR
const DDSURFACEDESC *expect = &param->modes[param->count];
ok(desc->dwWidth == expect->dwWidth, "Expected width %lu, got %lu.\n", expect->dwWidth, desc->dwWidth);
ok(desc->dwHeight == expect->dwHeight, "Expected height %lu, got %lu.\n", expect->dwHeight, desc->dwHeight);
ok(!memcmp(&U4(*desc).ddpfPixelFormat, &U4(*expect).ddpfPixelFormat, sizeof(U4(*desc).ddpfPixelFormat)),
ok(!memcmp(&desc->ddpfPixelFormat, &expect->ddpfPixelFormat, sizeof(desc->ddpfPixelFormat)),
"Pixel formats didn't match.\n");
}
......@@ -13027,7 +13027,7 @@ static void test_enum_surfaces(void)
desc.dwSize = sizeof(desc);
desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT;
desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
U2(desc).dwMipMapCount = 3;
desc.dwMipMapCount = 3;
desc.dwWidth = 32;
desc.dwHeight = 32;
hr = IDirectDraw_CreateSurface(ddraw, &desc, &param.surfaces[0], NULL);
......@@ -13111,7 +13111,7 @@ static void test_enum_surfaces(void)
param.mode_count = 0;
desc.dwFlags |= DDSD_PIXELFORMAT;
U4(desc).ddpfPixelFormat = current_format;
desc.ddpfPixelFormat = current_format;
hr = IDirectDraw_EnumDisplayModes(ddraw, 0, &desc, &param, build_mode_list_cb);
ok(hr == DD_OK, "Failed to build mode list, hr %#lx.\n", hr);
......@@ -13396,9 +13396,9 @@ static void test_viewport(void)
full_viewport = create_viewport(device, 0, 0, 640, 480);
viewport_set_background(device, full_viewport, black_background);
U1(clear_rect).x1 = U2(clear_rect).y1 = 0;
U3(clear_rect).x2 = 640;
U4(clear_rect).y2 = 480;
clear_rect.x1 = clear_rect.y1 = 0;
clear_rect.x2 = 640;
clear_rect.y2 = 480;
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
......@@ -13721,7 +13721,7 @@ static void test_gdi_surface(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
U5(surface_desc).dwBackBufferCount = 1;
surface_desc.dwBackBufferCount = 1;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface_GetAttachedSurface(primary, &caps, &backbuffer);
......@@ -14241,7 +14241,7 @@ static void test_d32_support(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = 32;
surface_desc.dwZBufferBitDepth = 32;
surface_desc.dwWidth = 64;
surface_desc.dwHeight = 64;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
......@@ -14252,8 +14252,8 @@ static void test_d32_support(void)
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok((surface_desc.dwFlags & DDSD_ZBUFFERBITDEPTH), "Got unexpected flags %#lx.\n", surface_desc.dwFlags);
ok(U2(surface_desc).dwZBufferBitDepth == 32,
"Got unexpected dwZBufferBitDepth %lu.\n", U2(surface_desc).dwZBufferBitDepth);
ok(surface_desc.dwZBufferBitDepth == 32,
"Got unexpected dwZBufferBitDepth %lu.\n", surface_desc.dwZBufferBitDepth);
ok(!(surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY),
"Got unexpected surface caps %#lx.\n", surface_desc.ddsCaps.dwCaps);
IDirectDrawSurface_Release(surface);
......@@ -14275,7 +14275,7 @@ static HRESULT CALLBACK find_different_mode_callback(DDSURFACEDESC *surface_desc
{
struct find_different_mode_param *param = context;
if (U1(U4(*surface_desc).ddpfPixelFormat).dwRGBBitCount != registry_mode.dmBitsPerPel)
if (surface_desc->ddpfPixelFormat.dwRGBBitCount != registry_mode.dmBitsPerPel)
return DDENUMRET_OK;
if (surface_desc->dwWidth != param->old_width && surface_desc->dwHeight != param->old_height)
......@@ -14713,7 +14713,7 @@ static void test_texture_wrong_caps(const GUID *device_guid)
ddsd.dwHeight = 16;
ddsd.dwWidth = 16;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
U4(ddsd).ddpfPixelFormat = fmt;
ddsd.ddpfPixelFormat = fmt;
hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture, (void **)&texture);
......@@ -15447,8 +15447,8 @@ START_TEST(ddraw1)
trace("Driver string: \"%s\"\n", identifier.szDriver);
trace("Description string: \"%s\"\n", identifier.szDescription);
trace("Driver version %d.%d.%d.%d\n",
HIWORD(U(identifier.liDriverVersion).HighPart), LOWORD(U(identifier.liDriverVersion).HighPart),
HIWORD(U(identifier.liDriverVersion).LowPart), LOWORD(U(identifier.liDriverVersion).LowPart));
HIWORD(identifier.liDriverVersion.HighPart), LOWORD(identifier.liDriverVersion.HighPart),
HIWORD(identifier.liDriverVersion.LowPart), LOWORD(identifier.liDriverVersion.LowPart));
}
IDirectDraw_Release(ddraw);
......
......@@ -374,7 +374,7 @@ static void fill_surface(IDirectDrawSurface *surface, D3DCOLOR color)
for (y = 0; y < surface_desc.dwHeight; ++y)
{
ptr = (DWORD *)((BYTE *)surface_desc.lpSurface + y * U1(surface_desc).lPitch);
ptr = (DWORD *)((BYTE *)surface_desc.lpSurface + y * surface_desc.lPitch);
for (x = 0; x < surface_desc.dwWidth; ++x)
{
ptr[x] = color;
......@@ -443,7 +443,7 @@ static DWORD get_device_z_depth(IDirect3DDevice2 *device)
if (FAILED(hr))
return 0;
return U2(desc).dwZBufferBitDepth;
return desc.dwZBufferBitDepth;
}
static IDirectDraw2 *create_ddraw(void)
......@@ -523,7 +523,7 @@ static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWOR
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
if (is_software_device_type(device_guid))
surface_desc.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
U2(surface_desc).dwZBufferBitDepth = z_depths[i];
surface_desc.dwZBufferBitDepth = z_depths[i];
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if (FAILED(IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL)))
......@@ -627,10 +627,10 @@ static IDirect3DMaterial2 *create_diffuse_material(IDirect3DDevice2 *device, flo
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U(mat).diffuse).r = r;
U2(U(mat).diffuse).g = g;
U3(U(mat).diffuse).b = b;
U4(U(mat).diffuse).a = a;
mat.diffuse.r = r;
mat.diffuse.g = g;
mat.diffuse.b = b;
mat.diffuse.a = a;
return create_material(device, &mat);
}
......@@ -642,15 +642,15 @@ static IDirect3DMaterial2 *create_diffuse_and_ambient_material(IDirect3DDevice2
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U(mat).diffuse).r = r;
U2(U(mat).diffuse).g = g;
U3(U(mat).diffuse).b = b;
U4(U(mat).diffuse).a = a;
mat.diffuse.r = r;
mat.diffuse.g = g;
mat.diffuse.b = b;
mat.diffuse.a = a;
U1(U(mat).ambient).r = r;
U2(U(mat).ambient).g = g;
U3(U(mat).ambient).b = b;
U4(U(mat).ambient).a = a;
mat.ambient.r = r;
mat.ambient.g = g;
mat.ambient.b = b;
mat.ambient.a = a;
return create_material(device, &mat);
}
......@@ -662,11 +662,11 @@ static IDirect3DMaterial2 *create_specular_material(IDirect3DDevice2 *device,
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U2(mat).specular).r = r;
U2(U2(mat).specular).g = g;
U3(U2(mat).specular).b = b;
U4(U2(mat).specular).a = a;
U4(mat).power = power;
mat.specular.r = r;
mat.specular.g = g;
mat.specular.b = b;
mat.specular.a = a;
mat.power = power;
return create_material(device, &mat);
}
......@@ -677,10 +677,10 @@ static IDirect3DMaterial2 *create_emissive_material(IDirect3DDevice2 *device, fl
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U3(mat).emissive).r = r;
U2(U3(mat).emissive).g = g;
U3(U3(mat).emissive).b = b;
U4(U3(mat).emissive).a = a;
mat.emissive.r = r;
mat.emissive.g = g;
mat.emissive.b = b;
mat.emissive.a = a;
return create_material(device, &mat);
}
......@@ -955,10 +955,10 @@ static void test_clipper_blt(void)
surface_desc.dwHeight = 480;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src_surface, NULL);
ok(SUCCEEDED(hr), "Failed to create source surface, hr %#lx.\n", hr);
......@@ -974,7 +974,7 @@ static void test_clipper_blt(void)
hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, DDLOCK_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#lx.\n", hr);
ok(U1(surface_desc).lPitch == 2560, "Got unexpected surface pitch %lu.\n", U1(surface_desc).lPitch);
ok(surface_desc.lPitch == 2560, "Got unexpected surface pitch %lu.\n", surface_desc.lPitch);
ptr = surface_desc.lpSurface;
memcpy(&ptr[ 0], &src_data[ 0], 6 * sizeof(DWORD));
memcpy(&ptr[ 640], &src_data[ 6], 6 * sizeof(DWORD));
......@@ -1001,7 +1001,7 @@ static void test_clipper_blt(void)
}
}
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#lx.\n", hr);
for (i = 0; i < 4; ++i)
......@@ -1135,10 +1135,10 @@ static void test_coop_level_d3d_state(void)
memset(&material, 0, sizeof(material));
material.dwSize = sizeof(material);
U1(U(material).diffuse).r = 0.0f;
U2(U(material).diffuse).g = 1.0f;
U3(U(material).diffuse).b = 0.0f;
U4(U(material).diffuse).a = 1.0f;
material.diffuse.r = 0.0f;
material.diffuse.g = 1.0f;
material.diffuse.b = 0.0f;
material.diffuse.a = 1.0f;
hr = IDirect3DMaterial2_SetMaterial(background, &material);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -1236,7 +1236,7 @@ static void test_surface_interface_mismatch(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = z_depth;
surface_desc.dwZBufferBitDepth = z_depth;
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL);
......@@ -1370,8 +1370,8 @@ static void test_depth_blit(const GUID *device_guid)
hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL);
ok(SUCCEEDED(hr), "Failed to set the z function, hr %#lx.\n", hr);
U1(d3drect).x1 = U2(d3drect).y1 = 0;
U3(d3drect).x2 = ddsd_existing.dwWidth; U4(d3drect).y2 = ddsd_existing.dwHeight;
d3drect.x1 = d3drect.y1 = 0;
d3drect.x2 = ddsd_existing.dwWidth; d3drect.y2 = ddsd_existing.dwHeight;
hr = IDirect3DViewport2_Clear(viewport, 1, &d3drect, D3DCLEAR_ZBUFFER);
ok(SUCCEEDED(hr), "Failed to clear the z buffer, hr %#lx.\n", hr);
......@@ -1427,7 +1427,7 @@ static void test_depth_blit(const GUID *device_guid)
* a reliable result(z = 0.0) */
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillDepth = 0;
fx.dwFillDepth = 0;
hr = IDirectDrawSurface_Blt(ds2, NULL, NULL, NULL, DDBLT_DEPTHFILL | DDBLT_WAIT, &fx);
ok(hr == D3D_OK || broken(is_software_device_type(device_guid)
&& hr == 0x8876086c /* D3DERR_INVALIDCALL */), "Got unexpected hr %#lx.\n", hr);
......@@ -1996,11 +1996,11 @@ static void test_ck_rgba(const GUID *device_guid)
surface_desc.dwHeight = 256;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0xff00ff00;
surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0xff00ff00;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
......@@ -2030,7 +2030,7 @@ static void test_ck_rgba(const GUID *device_guid)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = tests[i].fill_color;
fx.dwFillColor = tests[i].fill_color;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -2052,7 +2052,7 @@ static void test_ck_rgba(const GUID *device_guid)
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -2134,10 +2134,10 @@ static void test_ck_default(void)
surface_desc.dwHeight = 256;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x000000ff;
surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x000000ff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
......@@ -2150,7 +2150,7 @@ static void test_ck_default(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0x000000ff;
fx.dwFillColor = 0x000000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr);
......@@ -2895,7 +2895,7 @@ static void test_redundant_mode_set(void)
ok(SUCCEEDED(hr), "GetDisplayMode failed, hr %#lx.\n", hr);
hr = IDirectDraw2_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight,
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, 0, 0);
surface_desc.ddpfPixelFormat.dwRGBBitCount, 0, 0);
ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#lx.\n", hr);
GetWindowRect(window, &q);
......@@ -2907,7 +2907,7 @@ static void test_redundant_mode_set(void)
ok(EqualRect(&r, &s), "Expected %s, got %s.\n", wine_dbgstr_rect(&r), wine_dbgstr_rect(&s));
hr = IDirectDraw2_SetDisplayMode(ddraw, surface_desc.dwWidth, surface_desc.dwHeight,
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, 0, 0);
surface_desc.ddpfPixelFormat.dwRGBBitCount, 0, 0);
ok(SUCCEEDED(hr), "SetDisplayMode failed, hr %#lx.\n", hr);
GetWindowRect(window, &s);
......@@ -2953,7 +2953,7 @@ static HRESULT CALLBACK test_coop_level_mode_set_enum_cb(DDSURFACEDESC *surface_
{
struct test_coop_level_mode_set_enum_param *param = context;
if (U1(surface_desc->ddpfPixelFormat).dwRGBBitCount != registry_mode.dmBitsPerPel)
if (surface_desc->ddpfPixelFormat.dwRGBBitCount != registry_mode.dmBitsPerPel)
return DDENUMRET_OK;
if (surface_desc->dwWidth == registry_mode.dmPelsWidth
&& surface_desc->dwHeight == registry_mode.dmPelsHeight)
......@@ -5223,7 +5223,7 @@ static void test_rt_caps(const GUID *device_guid)
if (caps_in & DDSCAPS_ZBUFFER)
{
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(surface_desc).dwZBufferBitDepth = z_depth;
surface_desc.dwZBufferBitDepth = z_depth;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
......@@ -5312,7 +5312,7 @@ static void test_rt_caps(const GUID *device_guid)
if (test_data[i].caps_in & DDSCAPS_ZBUFFER)
{
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(surface_desc).dwZBufferBitDepth = z_depth;
surface_desc.dwZBufferBitDepth = z_depth;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
......@@ -5586,7 +5586,7 @@ static void test_surface_lock(void)
if (tests[i].caps & DDSCAPS_ZBUFFER)
{
ddsd.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(ddsd).dwZBufferBitDepth = z_depth;
ddsd.dwZBufferBitDepth = z_depth;
}
ddsd.ddsCaps.dwCaps = tests[i].caps;
......@@ -5996,10 +5996,10 @@ static void test_set_surface_desc(void)
ddsd.dwHeight = 8;
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;
ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
......@@ -6098,7 +6098,7 @@ static void test_set_surface_desc(void)
/* Pitch and width can be set, but only together, and only with LPSURFACE. They must not be 0. */
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_PITCH;
U1(ddsd).lPitch = 8 * 4;
ddsd.lPitch = 8 * 4;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
......@@ -6117,7 +6117,7 @@ static void test_set_surface_desc(void)
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE;
U1(ddsd).lPitch = 16 * 4;
ddsd.lPitch = 16 * 4;
ddsd.dwWidth = 16;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr);
......@@ -6127,47 +6127,47 @@ static void test_set_surface_desc(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(ddsd.dwWidth == 16, "SetSurfaceDesc: Expected width 8, got %lu.\n", ddsd.dwWidth);
ok(ddsd.dwHeight == 16, "SetSurfaceDesc: Expected height 16, got %lu.\n", ddsd.dwHeight);
ok(U1(ddsd).lPitch == 16 * 4, "SetSurfaceDesc: Expected pitch 64, got %lu.\n", U1(ddsd).lPitch);
ok(ddsd.lPitch == 16 * 4, "SetSurfaceDesc: Expected pitch 64, got %lu.\n", ddsd.lPitch);
/* The pitch must be 32 bit aligned and > 0, but is not verified for sanity otherwise.
*
* VMware rejects those calls, but all real drivers accept it. Mark the VMware behavior broken. */
ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE;
U1(ddsd).lPitch = 4 * 4;
ddsd.lPitch = 4 * 4;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDPARAMS), "Failed to set surface desc, hr %#lx.\n", hr);
U1(ddsd).lPitch = 4;
ddsd.lPitch = 4;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr) || broken(hr == DDERR_INVALIDPARAMS), "Failed to set surface desc, hr %#lx.\n", hr);
U1(ddsd).lPitch = 16 * 4 + 1;
ddsd.lPitch = 16 * 4 + 1;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
U1(ddsd).lPitch = 16 * 4 + 3;
ddsd.lPitch = 16 * 4 + 3;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
U1(ddsd).lPitch = -4;
ddsd.lPitch = -4;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
U1(ddsd).lPitch = 16 * 4;
ddsd.lPitch = 16 * 4;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE;
U1(ddsd).lPitch = 0;
ddsd.lPitch = 0;
ddsd.dwWidth = 16;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_LPSURFACE;
U1(ddsd).lPitch = 16 * 4;
ddsd.lPitch = 16 * 4;
ddsd.dwWidth = 0;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
......@@ -6176,10 +6176,10 @@ static void test_set_surface_desc(void)
ddsd.dwFlags = DDSD_PIXELFORMAT;
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 = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
......@@ -6210,15 +6210,15 @@ static void test_set_surface_desc(void)
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_WIDTH | DDSD_PITCH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_LPSURFACE;
ddsd.dwWidth = 8;
U1(ddsd).lPitch = 8 * 2;
ddsd.lPitch = 8 * 2;
ddsd.dwHeight = 8;
ddsd.lpSurface = data;
U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB; /* D3DFMT_R5G6B5 */
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.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; /* D3DFMT_R5G6B5 */
ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
ddsd.ddpfPixelFormat.dwRBitMask = 0xf800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x07e0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x001f;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
......@@ -6235,7 +6235,7 @@ static void test_set_surface_desc(void)
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT;
ddsd.dwWidth = 8;
ddsd.dwHeight = 8;
U2(ddsd).dwMipMapCount = 3;
ddsd.dwMipMapCount = 3;
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
......@@ -6267,7 +6267,7 @@ static void test_set_surface_desc(void)
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT;
ddsd.dwWidth = 8;
ddsd.dwHeight = 8;
U2(ddsd).dwMipMapCount = 3;
ddsd.dwMipMapCount = 3;
ddsd.lpSurface = data;
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
......@@ -6294,7 +6294,7 @@ static void test_set_surface_desc(void)
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE;
ddsd.dwWidth = 16;
ddsd.dwHeight = 16;
U1(ddsd).lPitch = 16 * 4;
ddsd.lPitch = 16 * 4;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -6303,7 +6303,7 @@ static void test_set_surface_desc(void)
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE;
ddsd.dwWidth = 8;
ddsd.dwHeight = 8;
U1(ddsd).lPitch = 8 * 4;
ddsd.lPitch = 8 * 4;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -6323,7 +6323,7 @@ static void test_set_surface_desc(void)
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE;
ddsd.dwWidth = 4;
ddsd.dwHeight = 4;
U1(ddsd).lPitch = 4 * 4;
ddsd.lPitch = 4 * 4;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface2, &ddsd, 0);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -6338,7 +6338,7 @@ static void test_set_surface_desc(void)
ddsd.dwWidth = 8;
ddsd.dwHeight = 8;
ddsd.lpSurface = data;
U1(ddsd).lPitch = 8 * 4;
ddsd.lPitch = 8 * 4;
ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#lx.\n", hr);
......@@ -6358,10 +6358,10 @@ static void test_set_surface_desc(void)
ddsd.dwHeight = 8;
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 = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
......@@ -6433,10 +6433,10 @@ static void test_user_memory_getdc(void)
ddsd.dwHeight = 16;
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;
ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -6471,7 +6471,7 @@ static void test_user_memory_getdc(void)
ddsd.lpSurface = data;
ddsd.dwWidth = 4;
ddsd.dwHeight = 8;
U1(ddsd).lPitch = sizeof(*data);
ddsd.lPitch = sizeof(*data);
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#lx.\n", hr);
......@@ -6533,10 +6533,10 @@ static void test_sysmem_overlay(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OVERLAY;
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 = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DDERR_NOOVERLAYHW, "Got unexpected hr %#lx.\n", hr);
......@@ -6658,8 +6658,8 @@ static void test_primary_palette(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth);
ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 8, "Got unexpected bit count %lu.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 8, "Got unexpected bit count %lu.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount);
hr = set_display_mode(ddraw, 640, 480);
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#lx.\n", hr);
......@@ -6670,9 +6670,9 @@ static void test_primary_palette(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth);
ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 32
|| U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 32
|| surface_desc.ddpfPixelFormat.dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", surface_desc.ddpfPixelFormat.dwRGBBitCount);
hr = IDirectDrawSurface_IsLost(primary);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr);
......@@ -6687,9 +6687,9 @@ static void test_primary_palette(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == 640, "Got unexpected surface width %lu.\n", surface_desc.dwWidth);
ok(surface_desc.dwHeight == 480, "Got unexpected surface height %lu.\n", surface_desc.dwHeight);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 32
|| U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", U1(surface_desc.ddpfPixelFormat).dwRGBBitCount);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == 32
|| surface_desc.ddpfPixelFormat.dwRGBBitCount == 24,
"Got unexpected bit count %lu.\n", surface_desc.ddpfPixelFormat.dwRGBBitCount);
done:
refcount = IDirectDrawSurface_Release(backbuffer);
......@@ -6732,7 +6732,7 @@ static void test_surface_attachment(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
U2(surface_desc).dwMipMapCount = 3;
surface_desc.dwMipMapCount = 3;
surface_desc.dwWidth = 128;
surface_desc.dwHeight = 128;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
......@@ -6900,8 +6900,8 @@ static void test_surface_attachment(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
surface_desc.ddpfPixelFormat.dwZBufferBitDepth = 16;
surface_desc.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
surface_desc.dwWidth = 32;
surface_desc.dwHeight = 32;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL);
......@@ -6940,10 +6940,10 @@ static void test_surface_attachment(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; /* D3DFMT_R5G6B5 */
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 16;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xf800;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x07e0;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x001f;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 16;
surface_desc.ddpfPixelFormat.dwRBitMask = 0xf800;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x07e0;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x001f;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface3, NULL);
......@@ -6951,8 +6951,8 @@ static void test_surface_attachment(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16;
U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff;
surface_desc.ddpfPixelFormat.dwZBufferBitDepth = 16;
surface_desc.ddpfPixelFormat.dwZBitMask = 0x0000ffff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -7307,13 +7307,13 @@ static void test_create_surface_pitch(void)
surface_desc.ddsCaps.dwCaps = test_data[i].caps;
surface_desc.dwWidth = 63;
surface_desc.dwHeight = 63;
U1(surface_desc).lPitch = test_data[i].pitch_in;
surface_desc.lPitch = test_data[i].pitch_in;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
if (test_data[i].flags_in & DDSD_LPSURFACE)
{
......@@ -7339,13 +7339,13 @@ static void test_create_surface_pitch(void)
if (!(test_data[i].caps & DDSCAPS_TEXTURE))
{
if (is_ddraw64 && test_data[i].pitch_out32 != test_data[i].pitch_out64)
todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64,
todo_wine ok(surface_desc.lPitch == test_data[i].pitch_out64,
"Test %u: Got unexpected pitch %#lx, expected %#lx.\n",
i, U1(surface_desc).lPitch, test_data[i].pitch_out64);
i, surface_desc.lPitch, test_data[i].pitch_out64);
else
ok(U1(surface_desc).lPitch == test_data[i].pitch_out32,
ok(surface_desc.lPitch == test_data[i].pitch_out32,
"Test %u: Got unexpected pitch %#lx, expected %#lx.\n",
i, U1(surface_desc).lPitch, test_data[i].pitch_out32);
i, surface_desc.lPitch, test_data[i].pitch_out32);
}
ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface);
......@@ -7453,7 +7453,7 @@ static void test_mipmap(void)
surface_desc.dwWidth = tests[i].width;
surface_desc.dwHeight = tests[i].height;
if (tests[i].flags & DDSD_MIPMAPCOUNT)
U2(surface_desc).dwMipMapCount = tests[i].mipmap_count_in;
surface_desc.dwMipMapCount = tests[i].mipmap_count_in;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#lx.\n", i, hr);
if (FAILED(hr))
......@@ -7469,12 +7469,12 @@ static void test_mipmap(void)
ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#lx.\n", i, hr);
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
"Test %u: Got unexpected flags %#lx.\n", i, surface_desc.dwFlags);
ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out,
"Test %u: Got unexpected mipmap count %lu.\n", i, U2(surface_desc).dwMipMapCount);
ok(surface_desc.dwMipMapCount == tests[i].mipmap_count_out,
"Test %u: Got unexpected mipmap count %lu.\n", i, surface_desc.dwMipMapCount);
surface_base = surface;
IDirectDrawSurface2_AddRef(surface_base);
mipmap_count = U2(surface_desc).dwMipMapCount;
mipmap_count = surface_desc.dwMipMapCount;
while (mipmap_count > 1)
{
hr = IDirectDrawSurface2_GetAttachedSurface(surface_base, &caps, &surface_mip);
......@@ -7486,9 +7486,9 @@ static void test_mipmap(void)
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#lx.\n", i, mipmap_count, hr);
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
"Test %u, %u: Got unexpected flags %#lx.\n", i, mipmap_count, surface_desc.dwFlags);
ok(U2(surface_desc).dwMipMapCount == mipmap_count,
ok(surface_desc.dwMipMapCount == mipmap_count,
"Test %u, %u: Got unexpected mipmap count %lu.\n",
i, mipmap_count, U2(surface_desc).dwMipMapCount);
i, mipmap_count, surface_desc.dwMipMapCount);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -7564,7 +7564,7 @@ static void test_palette_complex(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface);
......@@ -7695,7 +7695,7 @@ static void test_p8_blit(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst_p8, NULL);
......@@ -7711,11 +7711,11 @@ static void test_p8_blit(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -8130,11 +8130,11 @@ static void test_lighting(void)
memset(&light_desc, 0, sizeof(light_desc));
light_desc.dwSize = sizeof(light_desc);
light_desc.dltType = D3DLIGHT_DIRECTIONAL;
U1(light_desc.dcvColor).r = 0.0f;
U2(light_desc.dcvColor).g = 0.25f;
U3(light_desc.dcvColor).b = 1.0f;
U4(light_desc.dcvColor).a = 1.0f;
U3(light_desc.dvDirection).z = 1.0f;
light_desc.dcvColor.r = 0.0f;
light_desc.dcvColor.g = 0.25f;
light_desc.dcvColor.b = 1.0f;
light_desc.dcvColor.a = 1.0f;
light_desc.dvDirection.z = 1.0f;
hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport2_AddLight(viewport, light);
......@@ -8412,14 +8412,14 @@ static void test_specular_lighting(void)
{
for (x = 0; x < vertices_side; ++x)
{
U1(quad[i]).x = x * 2.0f / (vertices_side - 1) - 1.0f;
U2(quad[i]).y = y * 2.0f / (vertices_side - 1) - 1.0f;
U3(quad[i]).z = 1.0f;
U4(quad[i]).nx = 0.0f;
U5(quad[i]).ny = 0.0f;
U6(quad[i]).nz = -1.0f;
U7(quad[i]).tu = 0.0f;
U8(quad[i++]).tv = 0.0f;
quad[i].x = x * 2.0f / (vertices_side - 1) - 1.0f;
quad[i].y = y * 2.0f / (vertices_side - 1) - 1.0f;
quad[i].z = 1.0f;
quad[i].nx = 0.0f;
quad[i].ny = 0.0f;
quad[i].nz = -1.0f;
quad[i].tu = 0.0f;
quad[i++].tv = 0.0f;
}
}
for (i = 0, y = 0; y < (vertices_side - 1); ++y)
......@@ -8572,7 +8572,7 @@ static void test_palette_gdi(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 8;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -8698,12 +8698,12 @@ static void test_palette_gdi(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 3;
fx.dwFillColor = 3;
SetRect(&r, 0, 0, 319, 479);
hr = IDirectDrawSurface_Blt(primary, &r, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear surface, hr %#lx.\n", hr);
SetRect(&r, 320, 0, 639, 479);
U5(fx).dwFillColor = 4;
fx.dwFillColor = 4;
hr = IDirectDrawSurface_Blt(primary, &r, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear surface, hr %#lx.\n", hr);
......@@ -8974,10 +8974,10 @@ static void test_palette_alpha(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface);
......@@ -9046,10 +9046,10 @@ static void test_lost_device(void)
surface_desc.dwHeight = 64;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
if (FAILED(IDirectDraw2_CreateSurface(ddraw, &surface_desc, &vidmem_surface, NULL)))
{
skip("Failed to create video memory surface, skipping related tests.\n");
......@@ -9216,7 +9216,7 @@ static void test_lost_device(void)
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = 16;
surface_desc.dwZBufferBitDepth = 16;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL);
if (FAILED(hr))
{
......@@ -9484,11 +9484,11 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000ff;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -9504,10 +9504,10 @@ static void test_texturemapblend(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x800000ff;
fx.dwFillColor = 0x800000ff;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -9558,10 +9558,10 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
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 = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -9576,10 +9576,10 @@ static void test_texturemapblend(void)
hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x800000ff;
fx.dwFillColor = 0x800000ff;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -9614,11 +9614,11 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32;
U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000ff;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -9632,10 +9632,10 @@ static void test_texturemapblend(void)
hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x00ffffff;
fx.dwFillColor = 0x00ffffff;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x00ffff80;
fx.dwFillColor = 0x00ffff80;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -9673,10 +9673,10 @@ static void test_texturemapblend(void)
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
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;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -9691,10 +9691,10 @@ static void test_texturemapblend(void)
hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0xf800;
fx.dwFillColor = 0xf800;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
U5(fx).dwFillColor = 0x001f;
fx.dwFillColor = 0x001f;
hr = IDirectDrawSurface_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to clear texture, hr %#lx.\n", hr);
......@@ -10013,7 +10013,7 @@ static void test_color_fill(void)
/* Some Windows drivers modify dwFillColor when it is used on P8 or FourCC formats. */
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xdeadbeef;
fx.dwFillColor = 0xdeadbeef;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -10043,8 +10043,8 @@ static void test_color_fill(void)
{
surface_desc.dwFlags &= ~DDSD_PIXELFORMAT;
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
U2(surface_desc).dwZBufferBitDepth = get_device_z_depth(device);
mask >>= (32 - U2(surface_desc).dwZBufferBitDepth);
surface_desc.dwZBufferBitDepth = get_device_z_depth(device);
mask >>= (32 - surface_desc.dwZBufferBitDepth);
/* Some drivers seem to convert depth values incorrectly or not at
* all. Affects at least AMD PALM, 8.17.10.1247. */
if (tests[i].caps & DDSCAPS_VIDEOMEMORY)
......@@ -10101,7 +10101,7 @@ static void test_color_fill(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, DDLOCK_READONLY, 0);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx, surface %s.\n", hr, tests[i].name);
color = surface_desc.lpSurface;
todo_wine_if(tests[i].caps & DDSCAPS_VIDEOMEMORY && U2(surface_desc).dwZBufferBitDepth != 16)
todo_wine_if(tests[i].caps & DDSCAPS_VIDEOMEMORY && surface_desc.dwZBufferBitDepth != 16)
ok((*color & mask) == (tests[i].result & mask) || broken((*color & mask) == (expected_broken & mask))
|| broken(is_warp && (*color & mask) == (~0u & mask)) /* Windows 8+ testbot. */,
"Got clear result 0x%08x, expected 0x%08x, surface %s.\n",
......@@ -10110,13 +10110,13 @@ static void test_color_fill(void)
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx, surface %s.\n", hr, tests[i].name);
}
U5(fx).dwFillColor = 0xdeadbeef;
fx.dwFillColor = 0xdeadbeef;
fx.dwROP = BLACKNESS;
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_ROP | DDBLT_WAIT, &fx);
ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#lx, expected %s, surface %s.\n",
hr, tests[i].rop_success ? "success" : "failure", tests[i].name);
ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
U5(fx).dwFillColor, tests[i].name);
ok(fx.dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
fx.dwFillColor, tests[i].name);
if (SUCCEEDED(hr) && tests[i].check_result)
{
......@@ -10135,8 +10135,8 @@ static void test_color_fill(void)
hr = IDirectDrawSurface_Blt(surface, NULL, NULL, NULL, DDBLT_ROP | DDBLT_WAIT, &fx);
ok(FAILED(hr) == !tests[i].rop_success, "Blt returned %#lx, expected %s, surface %s.\n",
hr, tests[i].rop_success ? "success" : "failure", tests[i].name);
ok(U5(fx).dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
U5(fx).dwFillColor, tests[i].name);
ok(fx.dwFillColor == 0xdeadbeef, "dwFillColor was set to 0x%08lx, surface %s\n",
fx.dwFillColor, tests[i].name);
if (SUCCEEDED(hr) && tests[i].check_result)
{
......@@ -10157,7 +10157,7 @@ static void test_color_fill(void)
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xdeadbeef;
fx.dwFillColor = 0xdeadbeef;
fx.dwROP = WHITENESS;
memset(&surface_desc, 0, sizeof(surface_desc));
......@@ -10167,10 +10167,10 @@ static void test_color_fill(void)
surface_desc.dwHeight = 64;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -10255,7 +10255,7 @@ static void test_color_fill(void)
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_ZBUFFERBITDEPTH;
surface_desc.dwWidth = 64;
surface_desc.dwHeight = 64;
U2(surface_desc).dwZBufferBitDepth = get_device_z_depth(device);
surface_desc.dwZBufferBitDepth = get_device_z_depth(device);
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
......@@ -10449,12 +10449,12 @@ static void test_colorkey_precision(void)
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
U5(fx).dwFillColor = tests[t].clear;
fx.dwFillColor = tests[t].clear;
/* On the w8 testbot (WARP driver) the blit result has different values in the
* X channel. */
color_mask = U2(tests[t].fmt).dwRBitMask
| U3(tests[t].fmt).dwGBitMask
| U4(tests[t].fmt).dwBBitMask;
color_mask = tests[t].fmt.dwRBitMask
| tests[t].fmt.dwGBitMask
| tests[t].fmt.dwBBitMask;
for (c = 0; c <= tests[t].max; ++c)
{
......@@ -10646,11 +10646,11 @@ static void test_range_colorkey(void)
surface_desc.dwWidth = 1;
surface_desc.dwHeight = 1;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0x00000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0x00000000;
/* Creating a surface with a range color key fails with DDERR_NOCOLORKEY. */
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000;
......@@ -10922,10 +10922,10 @@ static void test_lockrect_invalid(void)
surface_desc.dwHeight = 128;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x00ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0xff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x00ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x0000ff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx, type %s.\n", hr, resources[r].name);
......@@ -11035,24 +11035,24 @@ static void test_yv12_overlay(void)
ok(desc.dwWidth == 256, "Got unexpected width %lu.\n", desc.dwWidth);
ok(desc.dwHeight == 256, "Got unexpected height %lu.\n", desc.dwHeight);
/* The overlay pitch seems to have 256 byte alignment. */
ok(!(U1(desc).lPitch & 0xff), "Got unexpected pitch %lu.\n", U1(desc).lPitch);
ok(!(desc.lPitch & 0xff), "Got unexpected pitch %lu.\n", desc.lPitch);
/* Fill the surface with some data for the blit test. */
base = desc.lpSurface;
/* Luminance */
for (y = 0; y < desc.dwHeight; ++y)
{
memset(base + U1(desc).lPitch * y, 0x10, desc.dwWidth);
memset(base + desc.lPitch * y, 0x10, desc.dwWidth);
}
/* V */
for (; y < desc.dwHeight + desc.dwHeight / 4; ++y)
{
memset(base + U1(desc).lPitch * y, 0x20, desc.dwWidth);
memset(base + desc.lPitch * y, 0x20, desc.dwWidth);
}
/* U */
for (; y < desc.dwHeight + desc.dwHeight / 2; ++y)
{
memset(base + U1(desc).lPitch * y, 0x30, desc.dwWidth);
memset(base + desc.lPitch * y, 0x30, desc.dwWidth);
}
hr = IDirectDrawSurface_Unlock(src_surface, NULL);
......@@ -11066,8 +11066,8 @@ static void test_yv12_overlay(void)
hr = IDirectDrawSurface_Lock(src_surface, &rect, &desc, DDLOCK_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#lx.\n", hr);
offset = ((const unsigned char *)desc.lpSurface - base);
ok(offset == rect.top * U1(desc).lPitch + rect.left, "Got unexpected offset %u, expected %lu.\n",
offset, rect.top * U1(desc).lPitch + rect.left);
ok(offset == rect.top * desc.lPitch + rect.left, "Got unexpected offset %u, expected %lu.\n",
offset, rect.top * desc.lPitch + rect.left);
hr = IDirectDrawSurface_Unlock(src_surface, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#lx.\n", hr);
......@@ -11094,9 +11094,9 @@ static void test_yv12_overlay(void)
base = desc.lpSurface;
ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]);
base += desc.dwHeight * U1(desc).lPitch;
base += desc.dwHeight * desc.lPitch;
ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
base += desc.dwHeight / 4 * U1(desc).lPitch;
base += desc.dwHeight / 4 * desc.lPitch;
ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
hr = IDirectDrawSurface_Unlock(dst_surface, NULL);
......@@ -11175,10 +11175,10 @@ static void test_offscreen_overlay(void)
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
surface_desc.ddpfPixelFormat.dwFourCC = 0;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 16;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0xf800;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x07e0;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x001f;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 16;
surface_desc.ddpfPixelFormat.dwRBitMask = 0xf800;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x07e0;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x001f;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &offscreen, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n",hr);
......@@ -11429,11 +11429,11 @@ static void test_blt_z_alpha(void)
memset(&pf, 0, sizeof(pf));
pf.dwSize = sizeof(pf);
pf.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(pf).dwRGBBitCount = 32;
U2(pf).dwRBitMask = 0x00ff0000;
U3(pf).dwGBitMask = 0x0000ff00;
U4(pf).dwBBitMask = 0x000000ff;
U5(pf).dwRGBAlphaBitMask = 0xff000000;
pf.dwRGBBitCount = 32;
pf.dwRBitMask = 0x00ff0000;
pf.dwGBitMask = 0x0000ff00;
pf.dwBBitMask = 0x000000ff;
pf.dwRGBAlphaBitMask = 0xff000000;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -11452,23 +11452,23 @@ static void test_blt_z_alpha(void)
fx.dwSize = sizeof(fx);
fx.dwZBufferOpCode = D3DCMP_NEVER;
fx.dwZDestConstBitDepth = 32;
U1(fx).dwZDestConst = 0x11111111;
fx.dwZDestConst = 0x11111111;
fx.dwZSrcConstBitDepth = 32;
U2(fx).dwZSrcConst = 0xeeeeeeee;
fx.dwZSrcConst = 0xeeeeeeee;
fx.dwAlphaEdgeBlendBitDepth = 8;
fx.dwAlphaEdgeBlend = 0x7f;
fx.dwAlphaDestConstBitDepth = 8;
U3(fx).dwAlphaDestConst = 0xdd;
fx.dwAlphaDestConst = 0xdd;
fx.dwAlphaSrcConstBitDepth = 8;
U4(fx).dwAlphaSrcConst = 0x22;
fx.dwAlphaSrcConst = 0x22;
for (i = 0; i < ARRAY_SIZE(blt_flags); ++i)
{
U5(fx).dwFillColor = 0x3300ff00;
fx.dwFillColor = 0x3300ff00;
hr = IDirectDrawSurface_Blt(src_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr);
U5(fx).dwFillColor = 0xccff0000;
fx.dwFillColor = 0xccff0000;
hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#lx.\n", i, hr);
......@@ -11546,16 +11546,16 @@ static void test_cross_device_blt(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 16;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00007c00;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x000003e0;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x0000001f;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 16;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00007c00;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x000003e0;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x0000001f;
hr = IDirectDraw2_CreateSurface(ddraw2, &surface_desc, &surface2, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
U5(fx).dwFillColor = 0xff0000ff;
fx.dwFillColor = 0xff0000ff;
hr = IDirectDrawSurface_Blt(surface2, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
ok(SUCCEEDED(hr), "Failed to fill surface, hr %#lx.\n", hr);
......@@ -11686,7 +11686,7 @@ static void test_getdc(void)
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc);
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr);
screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount;
screen_bpp = surface_desc.ddpfPixelFormat.dwRGBBitCount;
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
{
......@@ -11738,12 +11738,12 @@ static void test_getdc(void)
dib.dsBm.bmWidth, test_data[i].name);
ok(dib.dsBm.bmHeight == surface_desc.dwHeight, "Got unexpected height %d for format %s.\n",
dib.dsBm.bmHeight, test_data[i].name);
width_bytes = ((dib.dsBm.bmWidth * U1(test_data[i].format).dwRGBBitCount + 31) >> 3) & ~3;
width_bytes = ((dib.dsBm.bmWidth * test_data[i].format.dwRGBBitCount + 31) >> 3) & ~3;
ok(dib.dsBm.bmWidthBytes == width_bytes, "Got unexpected width bytes %d for format %s.\n",
dib.dsBm.bmWidthBytes, test_data[i].name);
ok(dib.dsBm.bmPlanes == 1, "Got unexpected plane count %d for format %s.\n",
dib.dsBm.bmPlanes, test_data[i].name);
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
ok(dib.dsBm.bmBitsPixel == test_data[i].format.dwRGBBitCount,
"Got unexpected bit count %d for format %s.\n",
dib.dsBm.bmBitsPixel, test_data[i].name);
/* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I
......@@ -11760,11 +11760,11 @@ static void test_getdc(void)
dib.dsBmih.biHeight, test_data[i].name);
ok(dib.dsBmih.biPlanes == 1, "Got unexpected plane count %u for format %s.\n",
dib.dsBmih.biPlanes, test_data[i].name);
ok(dib.dsBmih.biBitCount == U1(test_data[i].format).dwRGBBitCount,
ok(dib.dsBmih.biBitCount == test_data[i].format.dwRGBBitCount,
"Got unexpected bit count %u for format %s.\n",
dib.dsBmih.biBitCount, test_data[i].name);
ok(dib.dsBmih.biCompression == (U1(test_data[i].format).dwRGBBitCount == 16 ? BI_BITFIELDS : BI_RGB)
|| broken(U1(test_data[i].format).dwRGBBitCount == 32 && dib.dsBmih.biCompression == BI_BITFIELDS),
ok(dib.dsBmih.biCompression == (test_data[i].format.dwRGBBitCount == 16 ? BI_BITFIELDS : BI_RGB)
|| broken(test_data[i].format.dwRGBBitCount == 32 && dib.dsBmih.biCompression == BI_BITFIELDS),
"Got unexpected compression %#lx for format %s.\n",
dib.dsBmih.biCompression, test_data[i].name);
ok(!dib.dsBmih.biSizeImage, "Got unexpected image size %lu for format %s.\n",
......@@ -11780,9 +11780,9 @@ static void test_getdc(void)
if (dib.dsBmih.biCompression == BI_BITFIELDS)
{
ok((dib.dsBitfields[0] == U2(test_data[i].format).dwRBitMask
&& dib.dsBitfields[1] == U3(test_data[i].format).dwGBitMask
&& dib.dsBitfields[2] == U4(test_data[i].format).dwBBitMask)
ok((dib.dsBitfields[0] == test_data[i].format.dwRBitMask
&& dib.dsBitfields[1] == test_data[i].format.dwGBitMask
&& dib.dsBitfields[2] == test_data[i].format.dwBBitMask)
|| broken(!dib.dsBitfields[0] && !dib.dsBitfields[1] && !dib.dsBitfields[2]),
"Got unexpected colour masks 0x%08lx 0x%08lx 0x%08lx for format %s.\n",
dib.dsBitfields[0], dib.dsBitfields[1], dib.dsBitfields[2], test_data[i].name);
......@@ -12098,11 +12098,11 @@ static void test_edge_antialiasing_blending(void)
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat);
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &offscreen, NULL);
ok(hr == D3D_OK, "Creating the offscreen render target failed, hr %#lx.\n", hr);
......@@ -12446,12 +12446,12 @@ static void test_transform_vertices(void)
{D3DCLIP_FRONT, {-1.0f}, {-1.0f}, {-1.0f}}, {0, { 0.5f}, { 0.5f}, {0.5f}},
{D3DCLIP_FRONT, {-0.5f}, {-0.5f}, {-0.5f}}, {0, {-0.5f}, {-0.5f}, {0.0f}}
};
ok(compare_float(U1(cmp_h[i]).hx, U1(out_h[i]).hx, 4096)
&& compare_float(U2(cmp_h[i]).hy, U2(out_h[i]).hy, 4096)
&& compare_float(U3(cmp_h[i]).hz, U3(out_h[i]).hz, 4096)
ok(compare_float(cmp_h[i].hx, out_h[i].hx, 4096)
&& compare_float(cmp_h[i].hy, out_h[i].hy, 4096)
&& compare_float(cmp_h[i].hz, out_h[i].hz, 4096)
&& cmp_h[i].dwFlags == out_h[i].dwFlags,
"HVertex %u differs. Got %#lx %.8e %.8e %.8e.\n", i,
out_h[i].dwFlags, U1(out_h[i]).hx, U2(out_h[i]).hy, U3(out_h[i]).hz);
out_h[i].dwFlags, out_h[i].hx, out_h[i].hy, out_h[i].hz);
/* No scheme has been found behind those return values. It seems to be
* whatever data windows has when throwing the vertex away. Modify the
......@@ -12790,10 +12790,10 @@ static void test_transform_vertices(void)
memset(&mat, 0, sizeof(mat));
mat.dwSize = sizeof(mat);
U1(U(mat).diffuse).r = 0.0f;
U2(U(mat).diffuse).g = 1.0f;
U3(U(mat).diffuse).b = 0.0f;
U4(U(mat).diffuse).a = 0.0f;
mat.diffuse.r = 0.0f;
mat.diffuse.g = 1.0f;
mat.diffuse.b = 0.0f;
mat.diffuse.a = 0.0f;
hr = IDirect3DMaterial2_SetMaterial(background, &mat);
ok(SUCCEEDED(hr), "Failed to set material data, hr %#lx.\n", hr);
hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
......@@ -12859,12 +12859,12 @@ static void test_transform_vertices(void)
{0, {-25.59f}, {-6.39f }, { 0.0f }},
{D3DCLIP_LEFT | D3DCLIP_BOTTOM | D3DCLIP_FRONT,{-25.61f}, {-6.41f }, {-0.01f}},
};
ok(compare_float(U1(cmp_h[i]).hx, U1(out_h[i]).hx, 4096)
&& compare_float(U2(cmp_h[i]).hy, U2(out_h[i]).hy, 4096)
&& compare_float(U3(cmp_h[i]).hz, U3(out_h[i]).hz, 4096)
ok(compare_float(cmp_h[i].hx, out_h[i].hx, 4096)
&& compare_float(cmp_h[i].hy, out_h[i].hy, 4096)
&& compare_float(cmp_h[i].hz, out_h[i].hz, 4096)
&& cmp_h[i].dwFlags == out_h[i].dwFlags,
"HVertex %u differs. Got %#lx %.8e %.8e %.8e.\n", i,
out_h[i].dwFlags, U1(out_h[i]).hx, U2(out_h[i]).hy, U3(out_h[i]).hz);
out_h[i].dwFlags, out_h[i].hx, out_h[i].hy, out_h[i].hz);
}
IDirectDrawSurface_Release(rt);
......@@ -12917,8 +12917,8 @@ static void test_display_mode_surface_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#lx.\n", hr);
ok(surface_desc.dwWidth == width, "Got width %lu, expected %u.\n", surface_desc.dwWidth, width);
ok(surface_desc.dwHeight == height, "Got height %lu, expected %u.\n", surface_desc.dwHeight, height);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount, bpp);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
......@@ -12933,8 +12933,8 @@ static void test_display_mode_surface_pixel_format(void)
ok(surface_desc.dwHeight == height, "Got height %lu, expected %u.\n", surface_desc.dwHeight, height);
ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n",
surface_desc.ddpfPixelFormat.dwFlags);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount, bpp);
IDirectDrawSurface_Release(surface);
memset(&surface_desc, 0, sizeof(surface_desc));
......@@ -12949,8 +12949,8 @@ static void test_display_mode_surface_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#lx.\n", hr);
ok(surface_desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got unexpected pixel format flags %#lx.\n",
surface_desc.ddpfPixelFormat.dwFlags);
ok(U1(surface_desc.ddpfPixelFormat).dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount, bpp);
ok(surface_desc.ddpfPixelFormat.dwRGBBitCount == bpp, "Got bpp %lu, expected %u.\n",
surface_desc.ddpfPixelFormat.dwRGBBitCount, bpp);
IDirectDrawSurface_Release(surface);
refcount = IDirectDraw2_Release(ddraw);
......@@ -13195,10 +13195,10 @@ static void test_ck_operation(void)
surface_desc.dwHeight = 1;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&dst);
......@@ -13340,11 +13340,11 @@ static void test_ck_operation(void)
surface_desc.dwHeight = 1;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32;
U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000;
U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00;
U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff;
U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000;
surface_desc.ddpfPixelFormat.dwRGBBitCount = 32;
surface_desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
surface_desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
surface_desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
surface_desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&dst);
......@@ -13770,7 +13770,7 @@ static void test_depth_readback(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY;
U2(surface_desc).dwZBufferBitDepth = tests[i].z_depth;
surface_desc.dwZBufferBitDepth = tests[i].z_depth;
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL);
......@@ -13805,7 +13805,7 @@ static void test_depth_readback(void)
for (x = 80; x < 640; x += 160)
{
ptr = (BYTE *)surface_desc.lpSurface
+ y * U1(surface_desc).lPitch
+ y * surface_desc.lPitch
+ x * (tests[i].z_depth == 16 ? 2 : 4);
depth = *((DWORD *)ptr) & tests[i].z_mask;
expected_depth = (x * (0.9 / 640.0) + y * (0.1 / 480.0)) * tests[i].z_mask;
......@@ -13885,16 +13885,16 @@ static void test_clear(void)
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
/* Positive x, negative y. */
U1(rect[0]).x1 = 0;
U2(rect[0]).y1 = 480;
U3(rect[0]).x2 = 320;
U4(rect[0]).y2 = 240;
rect[0].x1 = 0;
rect[0].y1 = 480;
rect[0].x2 = 320;
rect[0].y2 = 240;
/* Positive x, positive y. */
U1(rect[1]).x1 = 0;
U2(rect[1]).y1 = 0;
U3(rect[1]).x2 = 320;
U4(rect[1]).y2 = 240;
rect[1].x1 = 0;
rect[1].y1 = 0;
rect[1].x2 = 320;
rect[1].y2 = 240;
/* Clear 2 rectangles with one call. Unlike d3d8/9, the refrast does not
* refuse negative rectangles, but it will not clear them either. */
......@@ -13917,10 +13917,10 @@ static void test_clear(void)
/* negative x, negative y.
* Also ignored, except on WARP, which clears the entire screen. */
U1(rect_negneg).x1 = 640;
U2(rect_negneg).y1 = 240;
U3(rect_negneg).x2 = 320;
U4(rect_negneg).y2 = 0;
rect_negneg.x1 = 640;
rect_negneg.y1 = 240;
rect_negneg.x2 = 320;
rect_negneg.y2 = 0;
viewport_set_background(device, viewport, green);
hr = IDirect3DViewport2_Clear(viewport, 1, &rect_negneg, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
......@@ -13959,10 +13959,10 @@ static void test_clear(void)
hr = IDirect3DDevice2_SetCurrentViewport(device, viewport3);
ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#lx.\n", hr);
U1(rect[0]).x1 = 160;
U2(rect[0]).y1 = 120;
U3(rect[0]).x2 = 480;
U4(rect[0]).y2 = 360;
rect[0].x1 = 160;
rect[0].y1 = 120;
rect[0].x2 = 480;
rect[0].y2 = 360;
viewport_set_background(device, viewport3, green);
hr = IDirect3DViewport2_Clear(viewport3, 1, &rect[0], D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
......@@ -14001,10 +14001,10 @@ static void test_clear(void)
* viewport. */
hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
U1(rect[0]).x1 = 330;
U2(rect[0]).y1 = 250;
U3(rect[0]).x2 = 340;
U4(rect[0]).y2 = 260;
rect[0].x1 = 330;
rect[0].y1 = 250;
rect[0].x2 = 340;
rect[0].y2 = 260;
hr = IDirect3DViewport2_Clear(viewport3, 1, &rect[0], D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
......@@ -14122,7 +14122,7 @@ static HRESULT WINAPI enum_surfaces_create_cb(IDirectDrawSurface *surface, DDSUR
const DDSURFACEDESC *expect = &param->modes[param->count];
ok(desc->dwWidth == expect->dwWidth, "Expected width %lu, got %lu.\n", expect->dwWidth, desc->dwWidth);
ok(desc->dwHeight == expect->dwHeight, "Expected height %lu, got %lu.\n", expect->dwHeight, desc->dwHeight);
ok(!memcmp(&U4(*desc).ddpfPixelFormat, &U4(*expect).ddpfPixelFormat, sizeof(U4(*desc).ddpfPixelFormat)),
ok(!memcmp(&desc->ddpfPixelFormat, &expect->ddpfPixelFormat, sizeof(desc->ddpfPixelFormat)),
"Pixel formats didn't match.\n");
}
......@@ -14163,7 +14163,7 @@ static void test_enum_surfaces(void)
desc.dwSize = sizeof(desc);
desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT;
desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP;
U2(desc).dwMipMapCount = 3;
desc.dwMipMapCount = 3;
desc.dwWidth = 32;
desc.dwHeight = 32;
hr = IDirectDraw2_CreateSurface(ddraw, &desc, &param.surfaces[0], NULL);
......@@ -14247,7 +14247,7 @@ static void test_enum_surfaces(void)
param.mode_count = 0;
desc.dwFlags |= DDSD_PIXELFORMAT;
U4(desc).ddpfPixelFormat = current_format;
desc.ddpfPixelFormat = current_format;
hr = IDirectDraw2_EnumDisplayModes(ddraw, 0, &desc, &param, build_mode_list_cb);
ok(hr == DD_OK, "Failed to build mode list, hr %#lx.\n", hr);
......@@ -14417,9 +14417,9 @@ static void test_viewport(void)
full_viewport = create_viewport(device, 0, 0, rt_sizes[i].x, rt_sizes[i].y);
viewport_set_background(device, full_viewport, black_background);
U1(clear_rect).x1 = U2(clear_rect).y1 = 0;
U3(clear_rect).x2 = rt_sizes[i].x;
U4(clear_rect).y2 = rt_sizes[i].y;
clear_rect.x1 = clear_rect.y1 = 0;
clear_rect.x2 = rt_sizes[i].x;
clear_rect.y2 = rt_sizes[i].y;
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
......@@ -14754,7 +14754,7 @@ static void test_gdi_surface(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
U5(surface_desc).dwBackBufferCount = 1;
surface_desc.dwBackBufferCount = 1;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface_GetAttachedSurface(primary, &caps, &backbuffer);
......@@ -15245,7 +15245,7 @@ static void test_d32_support(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = 32;
surface_desc.dwZBufferBitDepth = 32;
surface_desc.dwWidth = 64;
surface_desc.dwHeight = 64;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL);
......@@ -15256,8 +15256,8 @@ static void test_d32_support(void)
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok((surface_desc.dwFlags & DDSD_ZBUFFERBITDEPTH), "Got unexpected flags %#lx.\n", surface_desc.dwFlags);
ok(U2(surface_desc).dwZBufferBitDepth == 32,
"Got unexpected dwZBufferBitDepth %lu.\n", U2(surface_desc).dwZBufferBitDepth);
ok(surface_desc.dwZBufferBitDepth == 32,
"Got unexpected dwZBufferBitDepth %lu.\n", surface_desc.dwZBufferBitDepth);
ok(!(surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY),
"Got unexpected surface caps %#lx.\n", surface_desc.ddsCaps.dwCaps);
IDirectDrawSurface_Release(surface);
......@@ -15282,7 +15282,7 @@ static HRESULT CALLBACK find_different_mode_callback(DDSURFACEDESC *surface_desc
{
struct find_different_mode_param *param = context;
if (U1(U4(*surface_desc).ddpfPixelFormat).dwRGBBitCount != registry_mode.dmBitsPerPel)
if (surface_desc->ddpfPixelFormat.dwRGBBitCount != registry_mode.dmBitsPerPel)
return DDENUMRET_OK;
/* See comment in ddraw7 about the frequency. */
......@@ -15683,7 +15683,7 @@ static void test_texture_wrong_caps(const GUID *device_guid)
ddsd.dwHeight = 16;
ddsd.dwWidth = 16;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
U4(ddsd).ddpfPixelFormat = fmt;
ddsd.ddpfPixelFormat = fmt;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture);
......@@ -16432,8 +16432,8 @@ START_TEST(ddraw2)
trace("Driver string: \"%s\"\n", identifier.szDriver);
trace("Description string: \"%s\"\n", identifier.szDescription);
trace("Driver version %d.%d.%d.%d\n",
HIWORD(U(identifier.liDriverVersion).HighPart), LOWORD(U(identifier.liDriverVersion).HighPart),
HIWORD(U(identifier.liDriverVersion).LowPart), LOWORD(U(identifier.liDriverVersion).LowPart));
HIWORD(identifier.liDriverVersion.HighPart), LOWORD(identifier.liDriverVersion.HighPart),
HIWORD(identifier.liDriverVersion.LowPart), LOWORD(identifier.liDriverVersion.LowPart));
}
IDirectDraw2_Release(ddraw);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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);
}
}
......
......@@ -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);
......
......@@ -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