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 | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index f90a4d30456..2dc3e9b5c54 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -2798,6 +2798,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 2a5569f7836..1efea54462c 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -2247,13 +2247,13 @@ static void test_color_key(void) D3DFMT_A8R8G8B8, { 0, 0, 4, 4 }, a8r8g8b8_4_4, a8r8g8b8_4_4, 0x0000ff00, }, }; - unsigned int i, y, mismatch_count; PALETTEENTRY tmp_palette[256]; const uint8_t *expected_dst; IDirect3DDevice9 *device; D3DLOCKED_RECT lock_rect; IDirect3DSurface9 *surf; uint32_t src_pitch; + unsigned int i, y; RECT rect; HRESULT hr; HWND hwnd; @@ -2298,7 +2298,6 @@ static void test_color_key(void) 0xffff0000); ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
- mismatch_count = 0; expected_dst = (sizeof(void *) == 8) ? dxt5_4_4_expected_64_bit : dxt5_4_4_expected_32_bit; IDirect3DSurface9_LockRect(surf, &lock_rect, NULL, D3DLOCK_READONLY); for (y = 0; y < 4; ++y) @@ -2306,13 +2305,10 @@ static void test_color_key(void) const uint8_t *dst_expected_row = ((const uint8_t *)expected_dst) + (sizeof(uint32_t) * 4 * y); const uint8_t *dst_row = ((const uint8_t *)lock_rect.pBits) + (lock_rect.Pitch * y);
- if (memcmp(dst_row, dst_expected_row, sizeof(uint32_t) * 4)) - mismatch_count++; + ok(!memcmp(dst_row, dst_expected_row, sizeof(uint32_t) * 4), "Unexpected line %u.\n", y); } IDirect3DSurface9_UnlockRect(surf);
- todo_wine_if(sizeof(void *) == 4) ok(!mismatch_count, "Unexpected number of mismatched lines %u.\n", mismatch_count); - /* * Trying to use D3DX_FILTER_SRGB_IN with a color key results in * STATUS_ACCESS_VIOLATION on native.