From aa1d24f09bd78ebfc5c15438f3de1602b5dd6f85 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sun, 12 May 2013 23:57:50 +0200 Subject: [PATCH] d3dx9_36: Report D3DFMT_P8 for image with indexed colors in D3DGetImageInfoFromFileInMemory. --- dlls/d3dx9_36/surface.c | 6 +++--- dlls/d3dx9_36/tests/surface.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 81bdd78d3a0..82ead6054c4 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -37,9 +37,9 @@ static const struct const GUID *wic_guid; D3DFORMAT d3dformat; } wic_pixel_formats[] = { - { &GUID_WICPixelFormat8bppIndexed, D3DFMT_L8 }, - { &GUID_WICPixelFormat1bppIndexed, D3DFMT_L8 }, - { &GUID_WICPixelFormat4bppIndexed, D3DFMT_L8 }, + { &GUID_WICPixelFormat8bppIndexed, D3DFMT_P8 }, + { &GUID_WICPixelFormat1bppIndexed, D3DFMT_P8 }, + { &GUID_WICPixelFormat4bppIndexed, D3DFMT_P8 }, { &GUID_WICPixelFormat16bppBGR555, D3DFMT_X1R5G5B5 }, { &GUID_WICPixelFormat16bppBGR565, D3DFMT_R5G6B5 }, { &GUID_WICPixelFormat24bppBGR, D3DFMT_R8G8B8 }, diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 15707f7d7dc..94242d106f3 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -481,17 +481,17 @@ static void test_D3DXGetImageInfo(void) hr = D3DXGetImageInfoFromFileInMemory(bmp_1bpp, sizeof(bmp_1bpp), &info); ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth); - todo_wine ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8); + ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8); hr = D3DXGetImageInfoFromFileInMemory(bmp_2bpp, sizeof(bmp_2bpp), &info); ok(hr == D3DXERR_INVALIDDATA, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3DXERR_INVALIDDATA); hr = D3DXGetImageInfoFromFileInMemory(bmp_4bpp, sizeof(bmp_4bpp), &info); ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth); - todo_wine ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8); + ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8); hr = D3DXGetImageInfoFromFileInMemory(bmp_8bpp, sizeof(bmp_8bpp), &info); ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth); - todo_wine ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8); + ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8); /* test DDS support */ hr = D3DXGetImageInfoFromFileInMemory(dds_24bit, sizeof(dds_24bit), &info); @@ -646,7 +646,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) /* D3DXLoadSurfaceFromFile */ if(testbitmap_ok) { hr = D3DXLoadSurfaceFromFileA(surf, NULL, NULL, "testbitmap.bmp", NULL, D3DX_DEFAULT, 0, NULL); - ok(hr == D3D_OK, "D3DXLoadSurfaceFromFile returned %#x, expected %#x\n", hr, D3D_OK); + todo_wine ok(hr == D3D_OK, "D3DXLoadSurfaceFromFile returned %#x, expected %#x\n", hr, D3D_OK); hr = D3DXLoadSurfaceFromFileA(NULL, NULL, NULL, "testbitmap.bmp", NULL, D3DX_DEFAULT, 0, NULL); ok(hr == D3DERR_INVALIDCALL, "D3DXLoadSurfaceFromFile returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); @@ -683,7 +683,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) /* D3DXLoadSurfaceFromFileInMemory */ hr = D3DXLoadSurfaceFromFileInMemory(surf, NULL, NULL, bmp_1bpp, sizeof(bmp_1bpp), NULL, D3DX_DEFAULT, 0, NULL); - ok(hr == D3D_OK, "D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); + todo_wine ok(hr == D3D_OK, "D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); hr = D3DXLoadSurfaceFromFileInMemory(surf, NULL, NULL, noimage, sizeof(noimage), NULL, D3DX_DEFAULT, 0, NULL); ok(hr == D3DXERR_INVALIDDATA, "D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n", hr, D3DXERR_INVALIDDATA);