d3dx9: Rename copy_simple_data to convert_argb_pixels.

This commit is contained in:
Józef Kucia 2012-10-28 22:59:54 +01:00 committed by Alexandre Julliard
parent 5059da9e32
commit a513da063f
3 changed files with 11 additions and 10 deletions

View File

@ -72,9 +72,10 @@ HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer) DECLSPE
const struct pixel_format_desc *get_format_info(D3DFORMAT format) DECLSPEC_HIDDEN;
const struct pixel_format_desc *get_format_info_idx(int idx) DECLSPEC_HIDDEN;
void copy_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, struct volume *src_size, const struct pixel_format_desc *src_format,
BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, struct volume *dst_size, const struct pixel_format_desc *dst_format,
D3DCOLOR color_key) DECLSPEC_HIDDEN;
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;
void point_filter_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, struct volume *src_size, const struct pixel_format_desc *src_format,
BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, struct volume *dst_size, const struct pixel_format_desc *dst_format,
D3DCOLOR color_key) DECLSPEC_HIDDEN;

View File

@ -504,7 +504,7 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
volume.width = src_desc.Width;
volume.height = src_desc.Height;
volume.depth = 1;
copy_simple_data(locked_rect.pBits, locked_rect.Pitch, 0, &volume, pixel_format,
convert_argb_pixels(locked_rect.pBits, locked_rect.Pitch, 0, &volume, pixel_format,
pixels, dst_pitch, 0, &volume, pixel_format, 0);
IDirect3DSurface9_UnlockRect(src_surface);
@ -1355,16 +1355,16 @@ static void format_from_vec4(const struct pixel_format_desc *format, const struc
}
/************************************************************
* copy_simple_data
* convert_argb_pixels
*
* Copies the source buffer to the destination buffer, performing
* any necessary format conversion and color keying.
* Pixels outsize the source rect are blacked out.
* Works only for ARGB formats with 1 - 4 bytes per pixel.
*/
void copy_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, struct volume *src_size,
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,
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)
{
struct argb_conversion_info conv_info, ck_conv_info;
const struct pixel_format_desc *ck_format = NULL;
@ -1691,7 +1691,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
if ((filter & 0xf) == D3DX_FILTER_NONE)
{
copy_simple_data(src_memory, src_pitch, 0, &src_size, srcformatdesc,
convert_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key);
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
@ -1976,7 +1976,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
hr = IDirect3DSurface9_LockRect(src_surface, &locked_rect, src_rect, D3DLOCK_READONLY);
if (SUCCEEDED(hr))
{
copy_simple_data(locked_rect.pBits, locked_rect.Pitch, 0, &size, src_format_desc,
convert_argb_pixels(locked_rect.pBits, locked_rect.Pitch, 0, &size, src_format_desc,
dst_data, dst_pitch, 0, &size, dst_format_desc, 0);
IDirect3DSurface9_UnlockRect(src_surface);
}

View File

@ -212,7 +212,7 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume,
if ((filter & 0xf) == D3DX_FILTER_NONE)
{
copy_simple_data(src_memory, src_row_pitch, src_slice_pitch, &src_size, src_format_desc,
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);
}
else