From 9867c39133f260eead2e7a041eae1d1fd775dcf1 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Wed, 24 Nov 2010 16:06:07 +0100 Subject: [PATCH] d3dx9/tests: Fix a D3DXCheckTextureRequirements test failing on Windows. --- dlls/d3dx9_36/tests/texture.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index c1af04fde1..1f31d8104d 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -171,11 +171,17 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device) IDirect3DDevice9_GetCreationParameters(device, ¶ms); IDirect3DDevice9_GetDisplayMode(device, 0, &mode); - if(SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, - mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_R3G3B2))) + if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, + mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_R3G3B2))) expected = D3DFMT_R3G3B2; else - expected = D3DFMT_X4R4G4B4; + { + if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, + mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_X4R4G4B4))) + expected = D3DFMT_X4R4G4B4; + else + expected = D3DFMT_X1R5G5B5; + } format = D3DFMT_R3G3B2; hr = D3DXCheckTextureRequirements(device, NULL, NULL, NULL, 0, &format, D3DPOOL_DEFAULT);