Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
- if (is_index_format(src_desc) && (src_desc->block_width > 1))
- {
uint32_t unpacked_row_pitch, unpacked_slice_pitch;
const struct pixel_format_desc *unpacked_desc;
void *unpacked_mem = NULL;
hr = d3dx_pixels_unpack_index(src_pixels, src_desc, &unpacked_mem, &unpacked_row_pitch,
&unpacked_slice_pitch, &unpacked_desc);
if (SUCCEEDED(hr))
{
struct d3dx_pixels unpacked_pixels;
d3dx_pixels_init(unpacked_mem, unpacked_row_pitch, unpacked_slice_pitch, src_pixels->palette,
unpacked_desc->format, 0, 0, src_pixels->size.width, src_pixels->size.height,
0, src_pixels->size.depth, &unpacked_pixels);
I haven't really thought it through, but it might be slightly nicer to return `unpacked_pixels` directly from `d3dx_pixels_unpack_index`.