From 72ad4e7dc18446b83d193dc293d0e59a5adaf4a5 Mon Sep 17 00:00:00 2001 From: Ziqing Hui Date: Thu, 23 Jul 2020 14:03:00 +0800 Subject: [PATCH] windowscodecs: Fix alpha mode of DXT3 and DXT5 image. Signed-off-by: Ziqing Hui Signed-off-by: Esme Povirk Signed-off-by: Alexandre Julliard --- dlls/windowscodecs/ddsformat.c | 15 ++++++--------- dlls/windowscodecs/tests/ddsformat.c | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c index 447eaf41789..87cbf4df912 100644 --- a/dlls/windowscodecs/ddsformat.c +++ b/dlls/windowscodecs/ddsformat.c @@ -259,15 +259,12 @@ static WICDdsAlphaMode get_alpha_mode_from_fourcc(DWORD fourcc) { switch (fourcc) { - case MAKEFOURCC('D', 'X', 'T', '1'): - case MAKEFOURCC('D', 'X', 'T', '2'): - case MAKEFOURCC('D', 'X', 'T', '4'): - return WICDdsAlphaModePremultiplied; - case MAKEFOURCC('D', 'X', 'T', '3'): - case MAKEFOURCC('D', 'X', 'T', '5'): - return WICDdsAlphaModeStraight; - default: - return WICDdsAlphaModeUnknown; + case MAKEFOURCC('D', 'X', 'T', '1'): + case MAKEFOURCC('D', 'X', 'T', '2'): + case MAKEFOURCC('D', 'X', 'T', '4'): + return WICDdsAlphaModePremultiplied; + default: + return WICDdsAlphaModeUnknown; } } diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 4d42cd3c2d7..49de7e566ed 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -650,7 +650,6 @@ static void test_dds_decoder_image_parameters(void) "Test %u: Expected DxgiFormat %#x, got %#x\n", i, test_data[i].expected_parameters.DxgiFormat, parameters.DxgiFormat); ok(parameters.Dimension == test_data[i].expected_parameters.Dimension, "Test %u: Expected Dimension %#x, got %#x\n", i, test_data[i].expected_parameters.Dimension, parameters.Dimension); - todo_wine_if(test_data[i].data == test_dds_dxt5 || test_data[i].data == test_dds_dxt3) ok(parameters.AlphaMode == test_data[i].expected_parameters.AlphaMode, "Test %u: Expected AlphaMode %#x, got %#x\n", i, test_data[i].expected_parameters.AlphaMode, parameters.AlphaMode); }