Commit 4905773b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Only initially enable color keying for version 1 devices.

parent 23440d91
......@@ -6646,6 +6646,8 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_ZENABLE,
d3d_device_update_depth_stencil(device));
if (version == 1) /* Color keying is initially enabled for version 1 devices. */
wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_COLORKEYENABLE, TRUE);
return D3D_OK;
}
......
......@@ -131,11 +131,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer,
buffer->indices[(i * 3) + 1] = ci->u2.v2;
buffer->indices[(i * 3) + 2] = ci->u3.v3;
instr += size;
}
/* IDirect3DDevices have color keying always enabled -
* enable it before drawing. This overwrites any ALPHA*
* render state. */
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_COLORKEYENABLE, 1);
}
IDirect3DDevice7_DrawIndexedPrimitive(&device->IDirect3DDevice7_iface,
D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, tl_vx, 0, buffer->indices, count * 3, 0);
} break;
......
......@@ -1244,7 +1244,7 @@ static void test_ck_rgba(void)
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
color = get_surface_color(rt, 320, 240);
if (i == 2 || i == 3)
if (i == 2)
todo_wine ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color);
else
......@@ -1266,7 +1266,7 @@ static void test_ck_rgba(void)
/* This tests that fragments that are masked out by the color key are
* discarded, instead of just fully transparent. */
color = get_surface_color(rt, 320, 240);
if (i == 2 || i == 3)
if (i == 2)
todo_wine ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color);
else
......@@ -1427,7 +1427,7 @@ static void test_ck_default(void)
hr = IDirect3DDevice_EndScene(device);
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
color = get_surface_color(rt, 320, 240);
todo_wine ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color);
ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr);
......@@ -1439,7 +1439,7 @@ static void test_ck_default(void)
hr = IDirect3DDevice_EndScene(device);
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
color = get_surface_color(rt, 320, 240);
todo_wine ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color);
ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET);
ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\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