Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
return S_OK;
}
+/*
- Pack a d3dx_sub_resource structure for an image in memory, offsetting the
- base address if necessary.
- */
+static HRESULT set_d3dx_sub_resource_from_memory(const void *data, uint32_t row_pitch, uint32_t slice_pitch,
const PALETTEENTRY *palette, D3DFORMAT format, int32_t left, int32_t top, int32_t right, int32_t bottom,
uint32_t front, uint32_t back, struct d3dx_sub_resource *sub_rsrc)
It might be nicer to group those [in] params a bit, e.g. with a `D3DBOX`-like struct for the 6 "sides" values (btw, why this int/uint mix?)
The other thing that's a bit jarring here is the name of the function vs the API. This seems to be basically (part of) an object constructor, so we probably want to reflect that in the name, like `d3dx_sub_resource_init()` (while `_create()` would be the function doing the allocation + calling `_init()`). Looking at the whole branch, I think that's basically what you do for all those, so I think this might be only a matter of naming.