Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
- dst_locked_rect = *dst_rect;
- OffsetRect(&dst_locked_rect_aligned, -dst_rect_aligned.left, -dst_rect_aligned.top);
- OffsetRect(&dst_locked_rect, -dst_rect_aligned.left, -dst_rect_aligned.top);
- hr = d3dx_load_image_from_memory(lockrect.pBits, lockrect.Pitch, destformatdesc, dst_palette, &dst_locked_rect,
&dst_locked_rect_aligned, src_memory, src_pitch, srcformatdesc, src_palette, src_rect, filter, color_key);
- if (FAILED(hr))
WARN("d3dx_load_image_from_memory failed with hr %#lx\n", hr);
- dst_pixels.data = lockrect.pBits;
- dst_pixels.row_pitch = lockrect.Pitch;
- dst_pixels.slice_pitch = 0;
- dst_pixels.palette = dst_palette;
- dst_pixels.width = dst_rect_aligned.right - dst_rect_aligned.left;
- dst_pixels.height = dst_rect_aligned.bottom - dst_rect_aligned.top;
- dst_pixels.depth = 1;
- dst_pixels.unaligned_rect = *dst_rect;
- OffsetRect(&dst_pixels.unaligned_rect, -dst_rect_aligned.left, -dst_rect_aligned.top);
Would it make sense to use `d3dx_pixels_init()` here?