[PATCH 3/3] d3dx9_36: Add support for D3DFMT_P8 and conversion to other ARGB formats + tests.

Christian Costa titan.costa at gmail.com
Sun May 12 16:58:07 CDT 2013


Nore that source palette is forwarded downto low level conversion functions.
Palette from bmp in tests updated to have more various values to improve destination checking.
---
 dlls/d3dx9_36/d3dx9_36_private.h |    7 +++--
 dlls/d3dx9_36/surface.c          |   54 ++++++++++++++++++++++++++++++--------
 dlls/d3dx9_36/tests/surface.c    |   21 ++++++++++-----
 dlls/d3dx9_36/util.c             |   14 ++++++++--
 dlls/d3dx9_36/volume.c           |   10 +++++--
 5 files changed, 80 insertions(+), 26 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h
index 85f0871..08a73c2 100644
--- a/dlls/d3dx9_36/d3dx9_36_private.h
+++ b/dlls/d3dx9_36/d3dx9_36_private.h
@@ -50,6 +50,7 @@ enum format_type {
     FORMAT_ARGBF16,/* float 16 */
     FORMAT_ARGBF,  /* float */
     FORMAT_DXT,
+    FORMAT_INDEX,
     FORMAT_UNKNOWN
 };
 
@@ -63,7 +64,7 @@ struct pixel_format_desc {
     UINT block_byte_count;
     enum format_type type;
     void (*from_rgba)(const struct vec4 *src, struct vec4 *dst);
-    void (*to_rgba)(const struct vec4 *src, struct vec4 *dst);
+    void (*to_rgba)(const struct vec4 *src, struct vec4 *dst, const PALETTEENTRY *palette);
 };
 
 HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length) DECLSPEC_HIDDEN;
@@ -80,11 +81,11 @@ void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch,
 void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch,
     const struct volume *src_size, const struct pixel_format_desc *src_format,
     BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size,
-    const struct pixel_format_desc *dst_format, D3DCOLOR color_key) DECLSPEC_HIDDEN;
+    const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette) DECLSPEC_HIDDEN;
 void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch,
     const struct volume *src_size, const struct pixel_format_desc *src_format,
     BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size,
-    const struct pixel_format_desc *dst_format, D3DCOLOR color_key) DECLSPEC_HIDDEN;
+    const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette) DECLSPEC_HIDDEN;
 
 HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette,
     DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN;
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 82ead60..231e746 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -1025,7 +1025,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
     D3DXIMAGE_INFO imginfo;
     HRESULT hr;
 
-    IWICImagingFactory *factory;
+    IWICImagingFactory *factory = NULL;
     IWICBitmapDecoder *decoder;
     IWICBitmapFrameDecode *bitmapframe;
     IWICStream *stream;
@@ -1084,6 +1084,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
     if (FAILED(IWICImagingFactory_CreateStream(factory, &stream)))
     {
         IWICImagingFactory_Release(factory);
+        factory = NULL;
         goto cleanup_err;
     }
 
@@ -1092,7 +1093,6 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream*)stream, NULL, 0, &decoder);
 
     IWICStream_Release(stream);
-    IWICImagingFactory_Release(factory);
 
     if (FAILED(hr))
         goto cleanup_err;
@@ -1113,6 +1113,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
     {
         BYTE *buffer;
         DWORD pitch;
+        PALETTEENTRY *palette = NULL;
 
         pitch = formatdesc->bytes_per_pixel * wicrect.Width;
         buffer = HeapAlloc(GetProcessHeap(), 0, pitch * wicrect.Height);
@@ -1120,13 +1121,38 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
         hr = IWICBitmapFrameDecode_CopyPixels(bitmapframe, &wicrect, pitch,
                                               pitch * wicrect.Height, buffer);
 
+        if (SUCCEEDED(hr) && (formatdesc->type == FORMAT_INDEX))
+        {
+            IWICPalette *wic_palette = NULL;
+            UINT nb_colors;
+
+            hr = IWICImagingFactory_CreatePalette(factory, &wic_palette);
+            if (SUCCEEDED(hr))
+                hr = IWICBitmapFrameDecode_CopyPalette(bitmapframe, wic_palette);
+            if (SUCCEEDED(hr))
+                hr = IWICPalette_GetColorCount(wic_palette, &nb_colors);
+            if (SUCCEEDED(hr))
+            {
+                palette = HeapAlloc(GetProcessHeap(), 0, nb_colors * sizeof(WICColor));
+                if (!palette)
+                    hr = E_OUTOFMEMORY;
+            }
+            if (SUCCEEDED(hr)) {
+                /* PALETTEENTRY en WICColor are compatible */
+                hr = IWICPalette_GetColors(wic_palette, nb_colors, (WICColor*)palette, &nb_colors);
+            }
+            if (wic_palette)
+                IWICPalette_Release(wic_palette);
+        }
+
         if (SUCCEEDED(hr))
         {
             hr = D3DXLoadSurfaceFromMemory(pDestSurface, pDestPalette, pDestRect,
                                            buffer, imginfo.Format, pitch,
-                                           NULL, &rect, dwFilter, Colorkey);
+                                           palette, &rect, dwFilter, Colorkey);
         }
 
+        HeapFree(GetProcessHeap(), 0, palette);
         HeapFree(GetProcessHeap(), 0, buffer);
     }
 
@@ -1136,6 +1162,9 @@ cleanup_bmp:
     IWICBitmapDecoder_Release(decoder);
 
 cleanup_err:
+    if (factory)
+        IWICImagingFactory_Release(factory);
+
     CoUninitialize();
 
     if (imginfo.ImageFileFormat == D3DXIFF_DIB)
@@ -1466,7 +1495,8 @@ void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch,
  */
 void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size,
         const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch,
-        const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key)
+        const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key,
+        const PALETTEENTRY *palette)
 {
     struct argb_conversion_info conv_info, ck_conv_info;
     const struct pixel_format_desc *ck_format = NULL;
@@ -1520,7 +1550,7 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit
 
                     format_to_vec4(src_format, &pixel, &color);
                     if (src_format->to_rgba)
-                        src_format->to_rgba(&color, &tmp);
+                        src_format->to_rgba(&color, &tmp, palette);
                     else
                         tmp = color;
 
@@ -1565,7 +1595,8 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit
  */
 void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size,
         const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch,
-        const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key)
+        const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key,
+        const PALETTEENTRY *palette)
 {
     struct argb_conversion_info conv_info, ck_conv_info;
     const struct pixel_format_desc *ck_format = NULL;
@@ -1619,7 +1650,7 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
 
                     format_to_vec4(src_format, &pixel, &color);
                     if (src_format->to_rgba)
-                        src_format->to_rgba(&color, &tmp);
+                        src_format->to_rgba(&color, &tmp, palette);
                     else
                         tmp = color;
 
@@ -1767,7 +1798,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
     }
     else /* Stretching or format conversion. */
     {
-        if (srcformatdesc->type != FORMAT_ARGB || destformatdesc->type != FORMAT_ARGB)
+        if (((srcformatdesc->type != FORMAT_ARGB) && (srcformatdesc->type != FORMAT_INDEX)) ||
+            (destformatdesc->type != FORMAT_ARGB))
         {
             FIXME("Format conversion missing %#x -> %#x\n", src_format, surfdesc.Format);
             return E_NOTIMPL;
@@ -1779,7 +1811,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
         if ((filter & 0xf) == D3DX_FILTER_NONE)
         {
             convert_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
-                    lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key);
+                    lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
         }
         else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
         {
@@ -1789,7 +1821,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
             /* Always apply a point filter until D3DX_FILTER_LINEAR,
              * D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
             point_filter_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
-                    lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key);
+                    lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
         }
 
         IDirect3DSurface9_UnlockRect(dst_surface);
@@ -2064,7 +2096,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
             if (SUCCEEDED(hr))
             {
                 convert_argb_pixels(locked_rect.pBits, locked_rect.Pitch, 0, &size, src_format_desc,
-                    dst_data, dst_pitch, 0, &size, dst_format_desc, 0);
+                    dst_data, dst_pitch, 0, &size, dst_format_desc, 0, NULL);
                 IDirect3DSurface9_UnlockRect(src_surface);
             }
 
diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
index 94242d1..3d562d3 100644
--- a/dlls/d3dx9_36/tests/surface.c
+++ b/dlls/d3dx9_36/tests/surface.c
@@ -49,7 +49,7 @@ static const unsigned char bmp_1bpp[] = {
 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,
 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
-0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x00,
+0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x00,0xf4,0xf5,0xf6,0x00,0x00,0x00,
 0x00,0x00
 };
 
@@ -58,7 +58,7 @@ static const unsigned char bmp_2bpp[] = {
 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,
 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
-0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x00,
+0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x00,0xf4,0xf5,0xf6,0x00,0x00,0x00,
 0x00,0x00
 };
 
@@ -67,7 +67,7 @@ static const unsigned char bmp_4bpp[] = {
 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
-0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x00,
+0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x00,0xf4,0xf5,0xf6,0x00,0x00,0x00,
 0x00,0x00
 };
 
@@ -76,7 +76,7 @@ static const unsigned char bmp_8bpp[] = {
 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x00,0x00,
 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
-0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x00,
+0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x00,0xf4,0xf5,0xf6,0x00,0x00,0x00,
 0x00,0x00
 };
 
@@ -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);
-        todo_wine ok(hr == D3D_OK, "D3DXLoadSurfaceFromFile returned %#x, expected %#x\n", hr, D3D_OK);
+        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);
-    todo_wine ok(hr == D3D_OK, "D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
+    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);
@@ -746,7 +746,6 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
     hr = D3DXLoadSurfaceFromMemory(surf, NULL, &destrect, pixdata, D3DFMT_A8R8G8B8, sizeof(pixdata), NULL, &rect, D3DX_FILTER_NONE, 0);
     ok(hr == D3DERR_INVALIDCALL, "D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
 
-
     /* D3DXLoadSurfaceFromSurface */
     hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 256, 256, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &newsurf, NULL);
     if(SUCCEEDED(hr)) {
@@ -870,6 +869,14 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
         hr = IDirect3DSurface9_UnlockRect(surf);
         ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
 
+        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);
+        hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY);
+        ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x\n", hr);
+        ok(*(DWORD*)lockrect.pBits == 0xfff3f2f1, "Pixel color mismatch: got %#x, expected 0xfff3f2f1\n", *(DWORD*)lockrect.pBits);
+        hr = IDirect3DSurface9_UnlockRect(surf);
+        ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x\n", hr);
+
         check_release((IUnknown*)surf, 0);
     }
 
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
index 376fe89..1f1bd77 100644
--- a/dlls/d3dx9_36/util.c
+++ b/dlls/d3dx9_36/util.c
@@ -28,7 +28,7 @@ static void la_from_rgba(const struct vec4 *rgba, struct vec4 *la)
     la->w = rgba->w;
 }
 
-static void la_to_rgba(const struct vec4 *la, struct vec4 *rgba)
+static void la_to_rgba(const struct vec4 *la, struct vec4 *rgba, const PALETTEENTRY *palette)
 {
     rgba->x = la->x;
     rgba->y = la->x;
@@ -36,6 +36,16 @@ static void la_to_rgba(const struct vec4 *la, struct vec4 *rgba)
     rgba->w = la->w;
 }
 
+static void index_to_rgba(const struct vec4 *index, struct vec4 *rgba, const PALETTEENTRY *palette)
+{
+    ULONG idx = (ULONG)(index->x * 255.0f + 0.5f);
+
+    rgba->x = palette[idx].peBlue / 255.0f;
+    rgba->y = palette[idx].peGreen / 255.0f;
+    rgba->z = palette[idx].peRed / 255.0f;
+    rgba->w = palette[idx].peFlags / 255.0f;
+}
+
 /************************************************************
  * pixel format table providing info about number of bytes per pixel,
  * number of bits per channel and format type.
@@ -73,7 +83,7 @@ static const struct pixel_format_desc formats[] =
     {D3DFMT_DXT5,          { 0,  0,  0,  0}, { 0,  0,  0,  0},  1, 4, 4, 16, FORMAT_DXT,     NULL,         NULL      },
     {D3DFMT_A16B16G16R16F, {16, 16, 16, 16}, {48,  0, 16, 32},  8, 1, 1,  8, FORMAT_ARGBF16, NULL,         NULL      },
     {D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96,  0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF,   NULL,         NULL      },
-    {D3DFMT_P8,            { 8,  8,  8,  8}, { 0,  0,  0,  0},  1, 1, 1,  1, FORMAT_UNKNOWN, NULL,         NULL      },
+    {D3DFMT_P8,            { 8,  8,  8,  8}, { 0,  0,  0,  0},  1, 1, 1,  1, FORMAT_INDEX,   NULL,         index_to_rgba},
     /* marks last element */
     {D3DFMT_UNKNOWN,       { 0,  0,  0,  0}, { 0,  0,  0,  0},  0, 1, 1,  0, FORMAT_UNKNOWN, NULL,         NULL      },
 };
diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c
index 0dc0810..6ba758f 100644
--- a/dlls/d3dx9_36/volume.c
+++ b/dlls/d3dx9_36/volume.c
@@ -185,7 +185,9 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume,
     {
         const BYTE *src_addr;
 
-        if (src_format_desc->type != FORMAT_ARGB || dst_format_desc->type != FORMAT_ARGB)
+
+        if (((src_format_desc->type != FORMAT_ARGB) && (src_format_desc->type != FORMAT_INDEX)) ||
+            (dst_format_desc->type != FORMAT_ARGB))
         {
             FIXME("Pixel format conversion not implemented %#x -> %#x\n",
                     src_format_desc->format, dst_format_desc->format);
@@ -203,7 +205,8 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume,
         if ((filter & 0xf) == D3DX_FILTER_NONE)
         {
             convert_argb_pixels(src_memory, src_row_pitch, src_slice_pitch, &src_size, src_format_desc,
-                    locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, &dst_size, dst_format_desc, color_key);
+                    locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, &dst_size, dst_format_desc, color_key,
+                    src_palette);
         }
         else
         {
@@ -211,7 +214,8 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume,
                 FIXME("Unhandled filter %#x.\n", filter);
 
             point_filter_argb_pixels(src_addr, src_row_pitch, src_slice_pitch, &src_size, src_format_desc,
-                    locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, &dst_size, dst_format_desc, color_key);
+                    locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, &dst_size, dst_format_desc, color_key,
+                    src_palette);
         }
 
         IDirect3DVolume9_UnlockBox(dst_volume);




More information about the wine-patches mailing list