I previously mentioned that I had some color key fix but, as it turns out, I was wrong. What's left of that is a tiny cleanup patch...
From: Matteo Bruni mbruni@codeweavers.com
--- dlls/d3dx9_36/tests/texture.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 8e299a61360..a319db2413d 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -317,6 +317,7 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device) { UINT width, height, mipmaps; D3DFORMAT format, expected; + unsigned int expected_size; D3DCAPS9 caps; HRESULT hr; IDirect3D9 *d3d; @@ -538,8 +539,11 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device) if(SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, mode.Format, D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, D3DFMT_L16))) expected = D3DFMT_L16; - else + else if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, + mode.Format, D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16))) expected = D3DFMT_A16B16G16R16; + else + expected = D3DFMT_A2R10G10B10;
format = D3DFMT_L16; hr = D3DXCheckTextureRequirements(device, NULL, NULL, NULL, D3DUSAGE_RENDERTARGET, &format, D3DPOOL_DEFAULT); @@ -581,8 +585,12 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device) height = 9; hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - ok(width == 12, "Got unexpected width %u.\n", width); - ok(height == 12, "Got unexpected height %u.\n", height); + if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) + expected_size = 16; + else + expected_size = 12; + ok(width == expected_size, "Unexpected width %u, expected %u.\n", width, expected_size); + ok(height == expected_size, "Unexpected height %u, expected %u.\n", height, expected_size); ok(mipmaps == 1, "Got unexpected level count %u.\n", mipmaps); ok(format == D3DFMT_DXT5, "Got unexpected format %u.\n", format); }
From: Matteo Bruni mbruni@codeweavers.com
--- dlls/d3dx9_36/tests/texture.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index a319db2413d..bc9e5daaf1d 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -1674,11 +1674,17 @@ static void test_D3DXFillCubeTexture(IDirect3DDevice9 *device) /* A1R5G5B5 */ hr = IDirect3DDevice9_CreateCubeTexture(device, 4, 1, 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &tex, NULL); - ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - hr = D3DXFillCubeTexture(tex, fillfunc_cube, NULL); - ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); - compare_cube_texture(tex, fillfunc_cube, 2); - IDirect3DCubeTexture9_Release(tex); + if (SUCCEEDED(hr)) + { + hr = D3DXFillCubeTexture(tex, fillfunc_cube, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + compare_cube_texture(tex, fillfunc_cube, 2); + IDirect3DCubeTexture9_Release(tex); + } + else + { + skip("Texture format D3DFMT_A1R5G5B5 unsupported.\n"); + } }
static void WINAPI fillfunc_volume(D3DXVECTOR4 *value, const D3DXVECTOR3 *texcoord,
From: Matteo Bruni mbruni@codeweavers.com
--- dlls/d3dx9_36/surface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 674a400d37a..7ffc11af663 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1678,7 +1678,7 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit const PALETTEENTRY *palette) { struct argb_conversion_info conv_info, ck_conv_info; - const struct pixel_format_desc *ck_format = NULL; + const struct pixel_format_desc *ck_format; DWORD channels[4]; UINT min_width, min_height, min_depth; UINT x, y, z; @@ -1740,7 +1740,7 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit if (src_format->to_rgba) src_format->to_rgba(&color.value, &tmp.value, palette);
- if (ck_format) + if (color_key) { DWORD ck_pixel;
@@ -1784,7 +1784,7 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic const PALETTEENTRY *palette) { struct argb_conversion_info conv_info, ck_conv_info; - const struct pixel_format_desc *ck_format = NULL; + const struct pixel_format_desc *ck_format; DWORD channels[4]; UINT x, y, z;
@@ -1846,7 +1846,7 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic if (src_format->to_rgba) src_format->to_rgba(&color.value, &tmp.value, palette);
- if (ck_format) + if (color_key) { DWORD ck_pixel;