From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/surface.c | 4 ++-- dlls/d3dx9_36/tests/surface.c | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 3a6b8b78ebf..4786b29bfe3 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -2459,7 +2459,7 @@ static void convert_argb_pixel(const uint8_t *src_ptr, const struct pixel_format get_relevant_argb_components(ck_conv_info, src_ptr, channels); ck_pixel = make_argb_color(ck_conv_info, channels); if (ck_pixel == color_key) - val &= ~conv_info->destmask[0]; + val = 0; } memcpy(dst_ptr, &val, dst_fmt->bytes_per_pixel); } @@ -2476,7 +2476,7 @@ static void convert_argb_pixel(const uint8_t *src_ptr, const struct pixel_format
format_from_d3dx_color(ck_format, &tmp, (BYTE *)&ck_pixel); if (ck_pixel == color_key) - tmp.value.w = 0.0f; + tmp.value.x = tmp.value.y = tmp.value.z = tmp.value.w = 0.0f; }
color = tmp; diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 8d82562f969..fea5ec4295f 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -2319,6 +2319,7 @@ static void test_color_key(void) D3DCOLOR color_key; const void *expected_dst_data_32; BOOL todo; + BOOL todo_32; } tests[] = { /* Color key with alpha channel unset. */ @@ -2329,20 +2330,16 @@ static void test_color_key(void) /* Same color key as before except the alpha channel is set. */ { D3DFMT_R8G8B8, r8g8b8_4_4, r8g8b8_4_4_expected, 0xff008080, - .todo = TRUE }, /* Color key on a palette. */ { D3DFMT_P8, p8_4_4, p8_4_4_expected, 0xf0c0c000, - .todo = TRUE }, { D3DFMT_A8P8, a8p8_4_4, a8p8_4_4_expected, 0x10c0c000, - .todo = TRUE }, { D3DFMT_A32B32G32R32F, a32r32g32b32_4_4, a32r32g32b32_4_4_expected, 0xffff0000, - .todo = TRUE }, /* 5. */ /* @@ -2364,7 +2361,6 @@ static void test_color_key(void) /* Alpha channel factors into the color key check. */ { D3DFMT_A8R8G8B8, a8r8g8b8_4_4, a8r8g8b8_4_4_expected, 0x8000ff00, - .todo = TRUE }, { D3DFMT_A8R8G8B8, a8r8g8b8_4_4, a8r8g8b8_4_4, 0x0000ff00, @@ -2409,7 +2405,7 @@ static void test_color_key(void) */ { D3DFMT_DXT5, dxt5_4_4, dxt5_4_4_expected_ck, 0xffff0000, dxt5_4_4_expected_no_ck, - .todo = TRUE + .todo_32 = TRUE }, /* * Test premultiplied alpha handling with a color key - color key applies @@ -2486,7 +2482,8 @@ static void test_color_key(void) } IDirect3DSurface9_UnlockRect(surf);
- todo_wine_if(tests[i].todo) ok(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); + todo_wine_if(tests[i].todo || (sizeof(void *) == 4 && tests[i].todo_32)) ok(!mismatch_count, + "Unexpected number of mismatched pixels %u.\n", mismatch_count); winetest_pop_context(); }