[PATCH 6/7] ddraw/tests: Add more d3d7 lighting tests.
Matteo Bruni
mbruni at codeweavers.com
Mon Mar 30 13:18:05 CDT 2015
---
dlls/ddraw/tests/ddraw7.c | 228 ++++++++++++++++++++++++++++++++++++++++++++++
dlls/ddraw/tests/visual.c | 132 +--------------------------
2 files changed, 232 insertions(+), 128 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 21ba3390..816f89b 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -3408,6 +3408,233 @@ static void test_draw_strided(void)
DestroyWindow(window);
}
+static void test_lighting(void)
+{
+ static D3DMATRIX mat =
+ {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f,
+ },
+ mat_singular =
+ {
+ 1.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 1.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f,
+ },
+ mat_transf =
+ {
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ -1.0f, 0.0f, 0.0f, 0.0f,
+ 10.f, 10.0f, 10.0f, 1.0f,
+ };
+ static struct
+ {
+ struct vec3 position;
+ DWORD diffuse;
+ }
+ unlitquad[] =
+ {
+ {{-1.0f, -1.0f, 0.1f}, 0xffff0000},
+ {{-1.0f, 0.0f, 0.1f}, 0xffff0000},
+ {{ 0.0f, 0.0f, 0.1f}, 0xffff0000},
+ {{ 0.0f, -1.0f, 0.1f}, 0xffff0000},
+ },
+ litquad[] =
+ {
+ {{-1.0f, 0.0f, 0.1f}, 0xff00ff00},
+ {{-1.0f, 1.0f, 0.1f}, 0xff00ff00},
+ {{ 0.0f, 1.0f, 0.1f}, 0xff00ff00},
+ {{ 0.0f, 0.0f, 0.1f}, 0xff00ff00},
+ };
+ static struct
+ {
+ struct vec3 position;
+ struct vec3 normal;
+ DWORD diffuse;
+ }
+ unlitnquad[] =
+ {
+ {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
+ {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
+ {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
+ {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
+ },
+ litnquad[] =
+ {
+ {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
+ {{0.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
+ {{1.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
+ {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
+ },
+ nquad[] =
+ {
+ {{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, 0xff0000ff},
+ {{-1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, 0xff0000ff},
+ {{ 1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, 0xff0000ff},
+ {{ 1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, 0xff0000ff},
+ },
+ rotatedquad[] =
+ {
+ {{-10.0f, -11.0f, 11.0f}, {-1.0f, 0.0f, 0.0f}, 0xff0000ff},
+ {{-10.0f, -9.0f, 11.0f}, {-1.0f, 0.0f, 0.0f}, 0xff0000ff},
+ {{-10.0f, -9.0f, 9.0f}, {-1.0f, 0.0f, 0.0f}, 0xff0000ff},
+ {{-10.0f, -11.0f, 9.0f}, {-1.0f, 0.0f, 0.0f}, 0xff0000ff},
+ };
+ static WORD Indices[] = {0, 1, 2, 2, 3, 0};
+
+ HWND window;
+ IDirect3DDevice7 *device;
+ IDirectDrawSurface7 *rt;
+ HRESULT hr;
+ DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE;
+ DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL;
+ D3DCOLOR color;
+ ULONG refcount;
+
+ window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
+ 0, 0, 640, 480, 0, 0, 0, 0);
+ if (!(device = create_device(window, DDSCL_NORMAL)))
+ {
+ skip("Failed to create a 3D device, skipping test.\n");
+ DestroyWindow(window);
+ return;
+ }
+
+ hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
+ ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
+ ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat);
+ ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat);
+ ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat);
+ ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable stencil buffering, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE);
+ ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_BeginScene(device);
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
+
+ /* No lights are defined... That means, lit vertices should be entirely black. */
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, unlitquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE);
+ ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, litquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, unlitnquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE);
+ ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, litnquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_EndScene(device);
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
+
+ color = get_surface_color(rt, 160, 360);
+ ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x, expected 0x00ff0000.\n", color);
+ color = get_surface_color(rt, 160, 120);
+ ok(color == 0x00000000, "Lit quad without normals has color 0x%08x, expected 0x00000000.\n", color);
+ color = get_surface_color(rt, 480, 360);
+ ok(color == 0x000000ff, "Unlit quad with normals has color 0x%08x, expected 0x000000ff.\n", color);
+ color = get_surface_color(rt, 480, 120);
+ ok(color == 0x00000000, "Lit quad with normals has color 0x%08x, expected 0x00000000.\n", color);
+
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE);
+ ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_LightEnable(device, 0, TRUE);
+ ok(SUCCEEDED(hr), "Failed to enable light 0, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
+ ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_BeginScene(device);
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, nquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_EndScene(device);
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
+
+ color = get_surface_color(rt, 320, 240);
+ ok(color == 0x000000ff, "Lit quad with light has color 0x%08x.\n", color);
+
+ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat_singular);
+ ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
+ ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_BeginScene(device);
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, nquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_EndScene(device);
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
+
+ color = get_surface_color(rt, 160, 240);
+ ok(color == 0x00ffffff, "Cleared area has color 0x%08x.\n", color);
+ color = get_surface_color(rt, 480, 240);
+ ok(color == 0x000000ff, "Lit quad with singular world matrix has color 0x%08x.\n", color);
+
+ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat_transf);
+ ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
+ ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_BeginScene(device);
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, rotatedquad, 4,
+ Indices, 6, 0);
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice7_EndScene(device);
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
+
+ color = get_surface_color(rt, 320, 240);
+ ok(color == 0x000000ff, "Lit quad with transformation matrix has color 0x%08x.\n", color);
+
+ IDirectDrawSurface7_Release(rt);
+
+ refcount = IDirect3DDevice7_Release(device);
+ ok(!refcount, "Device has %u references left.\n", refcount);
+ DestroyWindow(window);
+}
+
static void test_clear_rect_count(void)
{
IDirectDrawSurface7 *rt;
@@ -9086,6 +9313,7 @@ START_TEST(ddraw7)
test_vb_discard();
test_coop_level_multi_window();
test_draw_strided();
+ test_lighting();
test_clear_rect_count();
test_coop_level_versions();
test_fog_special();
diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c
index 26e8e24..3ac8d4f 100644
--- a/dlls/ddraw/tests/visual.c
+++ b/dlls/ddraw/tests/visual.c
@@ -267,132 +267,6 @@ static void set_viewport_size(IDirect3DDevice7 *device)
return;
}
-static void lighting_test(IDirect3DDevice7 *device)
-{
- HRESULT hr;
- DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE;
- DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL;
- DWORD color;
-
- D3DMATRIX mat =
- {
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 1.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f,
- };
- struct
- {
- struct vec3 position;
- DWORD diffuse;
- }
- unlitquad[] =
- {
- {{-1.0f, -1.0f, 0.1f}, 0xffff0000},
- {{-1.0f, 0.0f, 0.1f}, 0xffff0000},
- {{ 0.0f, 0.0f, 0.1f}, 0xffff0000},
- {{ 0.0f, -1.0f, 0.1f}, 0xffff0000},
- },
- litquad[] =
- {
- {{-1.0f, 0.0f, 0.1f}, 0xff00ff00},
- {{-1.0f, 1.0f, 0.1f}, 0xff00ff00},
- {{ 0.0f, 1.0f, 0.1f}, 0xff00ff00},
- {{ 0.0f, 0.0f, 0.1f}, 0xff00ff00},
- };
- struct
- {
- struct vec3 position;
- struct vec3 normal;
- DWORD diffuse;
- }
- unlitnquad[] =
- {
- {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
- {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
- {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
- {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
- },
- litnquad[] =
- {
- {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
- {{0.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
- {{1.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
- {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00},
- };
- WORD Indices[] = {0, 1, 2, 2, 3, 0};
-
- hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
- ok(hr == D3D_OK, "IDirect3DDevice7_Clear failed with %08x\n", hr);
-
- /* Setup some states that may cause issues */
- hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetTransform returned %08x\n", hr);
- hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetTransform returned %08x\n", hr);
- hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetTransform returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ALPHATESTENABLE, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState failed with %08x\n", hr);
-
- hr = IDirect3DDevice7_BeginScene(device);
- ok(hr == D3D_OK, "IDirect3DDevice7_BeginScene failed with %08x\n", hr);
- if(hr == D3D_OK)
- {
- /* No lights are defined... That means, lit vertices should be entirely black */
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, unlitquad, 4 /* NumVerts */,
- Indices, 6 /* Indexcount */, 0 /* flags */);
- ok(hr == D3D_OK, "IDirect3DDevice7_DrawIndexedPrimitiveUP failed with %08x\n", hr);
-
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, fvf, litquad, 4 /* NumVerts */,
- Indices, 6 /* Indexcount */, 0 /* flags */);
- ok(hr == D3D_OK, "IDirect3DDevice7_DrawIndexedPrimitiveUP failed with %08x\n", hr);
-
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, unlitnquad, 4 /* NumVerts */,
- Indices, 6 /* Indexcount */, 0 /* flags */);
- ok(hr == D3D_OK, "IDirect3DDevice7_DrawIndexedPrimitiveUP failed with %08x\n", hr);
-
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, TRUE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
- hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, nfvf, litnquad, 4 /* NumVerts */,
- Indices, 6 /* Indexcount */, 0 /* flags */);
- ok(hr == D3D_OK, "IDirect3DDevice7_DrawIndexedPrimitiveUP failed with %08x\n", hr);
-
- hr = IDirect3DDevice7_EndScene(device);
- ok(hr == D3D_OK, "IDirect3DDevice7_EndScene failed with %08x\n", hr);
- }
-
- color = getPixelColor(device, 160, 360); /* Lower left quad - unlit without normals */
- ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x, expected 0x00ff0000.\n", color);
- color = getPixelColor(device, 160, 120); /* Upper left quad - lit without normals */
- ok(color == 0x00000000, "Lit quad without normals has color 0x%08x, expected 0x00000000.\n", color);
- color = getPixelColor(device, 480, 360); /* Lower right quad - unlit with normals */
- ok(color == 0x000000ff, "Unlit quad with normals has color 0x%08x, expected 0x000000ff.\n", color);
- color = getPixelColor(device, 480, 120); /* Upper right quad - lit with normals */
- ok(color == 0x00000000, "Lit quad with normals has color 0x%08x, expected 0x00000000.\n", color);
-
- hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
- ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState returned %08x\n", hr);
-}
-
static void clear_test(IDirect3DDevice7 *device)
{
/* Tests the correctness of clearing parameters */
@@ -541,7 +415,10 @@ static void fog_test(IDirect3DDevice7 *device)
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0);
ok(hr == D3D_OK, "IDirect3DDevice7_Clear returned %08x\n", hr);
- /* Setup initial states: No lighting, fog on, fog color */
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE);
+ ok(SUCCEEDED(hr), "Failed to disable z test, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE);
+ ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
ok(hr == D3D_OK, "Turning off lighting returned %08x\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, TRUE);
@@ -2255,7 +2132,6 @@ START_TEST(visual)
/* Now run the tests */
blt_test(Direct3DDevice);
depth_clamp_test(Direct3DDevice);
- lighting_test(Direct3DDevice);
clear_test(Direct3DDevice);
fog_test(Direct3DDevice);
offscreen_test(Direct3DDevice);
--
2.0.5
More information about the wine-patches
mailing list