From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/surface.c | 5 +++++ dlls/d3dx9_36/tests/surface.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 5b66e6872e9..575cb634afe 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -2886,6 +2886,11 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, uncompressed_desc->format, 0, 0, src_pixels->size.width, src_pixels->size.height, 0, src_pixels->size.depth, &uncompressed_pixels);
+ if (sizeof(void *) == 4 && color_key) + { + TRACE("Clearing color key value on compressed source pixels.\n"); + color_key = 0; + } hr = d3dx_load_pixels_from_pixels(dst_pixels, dst_desc, &uncompressed_pixels, uncompressed_desc, filter_flags, color_key); } diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index aa62d7d1c6d..9c592c7f851 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -2320,7 +2320,6 @@ static void test_color_key(void) const void *expected_dst_data_32; uint8_t max_diff; BOOL todo; - BOOL todo_32; } tests[] = { /* Color key with alpha channel unset. */ @@ -2397,7 +2396,6 @@ static void test_color_key(void) */ { D3DFMT_DXT5, dxt5_4_4, dxt5_4_4_expected_ck, 0xffff0000, dxt5_4_4_expected_no_ck, - .todo_32 = TRUE }, /* * Test premultiplied alpha handling with a color key - color key applies @@ -2474,8 +2472,7 @@ static void test_color_key(void) } IDirect3DSurface9_UnlockRect(surf);
- 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); + todo_wine_if(tests[i].todo) ok(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); winetest_pop_context(); }