ddraw: Rename PixelFormat_DD2WineD3D() to wined3dformat_from_ddrawformat().
For consistency with the other D3D dlls.
This commit is contained in:
parent
e8905e360f
commit
86eb211159
|
@ -552,7 +552,7 @@ struct d3d_vertex_buffer *unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVerte
|
||||||
(((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
|
(((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
|
||||||
|
|
||||||
void PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat, enum wined3d_format_id WineD3DFormat) DECLSPEC_HIDDEN;
|
void PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat, enum wined3d_format_id WineD3DFormat) DECLSPEC_HIDDEN;
|
||||||
enum wined3d_format_id PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat) DECLSPEC_HIDDEN;
|
enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *format) DECLSPEC_HIDDEN;
|
||||||
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN;
|
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN;
|
||||||
void dump_D3DMATRIX(const D3DMATRIX *mat) DECLSPEC_HIDDEN;
|
void dump_D3DMATRIX(const D3DMATRIX *mat) DECLSPEC_HIDDEN;
|
||||||
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) DECLSPEC_HIDDEN;
|
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -4328,7 +4328,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
|
||||||
if (DDSD->dwFlags & DDSD_PIXELFORMAT)
|
if (DDSD->dwFlags & DDSD_PIXELFORMAT)
|
||||||
{
|
{
|
||||||
enum wined3d_format_id current_format_id;
|
enum wined3d_format_id current_format_id;
|
||||||
format_id = PixelFormat_DD2WineD3D(&DDSD->u4.ddpfPixelFormat);
|
format_id = wined3dformat_from_ddrawformat(&DDSD->u4.ddpfPixelFormat);
|
||||||
|
|
||||||
if (format_id == WINED3DFMT_UNKNOWN)
|
if (format_id == WINED3DFMT_UNKNOWN)
|
||||||
{
|
{
|
||||||
|
@ -4336,7 +4336,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
current_format_id = PixelFormat_DD2WineD3D(&This->surface_desc.u4.ddpfPixelFormat);
|
current_format_id = wined3dformat_from_ddrawformat(&This->surface_desc.u4.ddpfPixelFormat);
|
||||||
if (format_id != current_format_id)
|
if (format_id != current_format_id)
|
||||||
{
|
{
|
||||||
TRACE("Surface format changed from %#x to %#x.\n", current_format_id, format_id);
|
TRACE("Surface format changed from %#x to %#x.\n", current_format_id, format_id);
|
||||||
|
@ -4345,7 +4345,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
format_id = PixelFormat_DD2WineD3D(&This->surface_desc.u4.ddpfPixelFormat);
|
format_id = wined3dformat_from_ddrawformat(&This->surface_desc.u4.ddpfPixelFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update_wined3d)
|
if (update_wined3d)
|
||||||
|
@ -5613,7 +5613,7 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
|
||||||
else
|
else
|
||||||
pool = WINED3D_POOL_DEFAULT;
|
pool = WINED3D_POOL_DEFAULT;
|
||||||
|
|
||||||
wined3d_desc.format = PixelFormat_DD2WineD3D(&surface->surface_desc.u4.ddpfPixelFormat);
|
wined3d_desc.format = wined3dformat_from_ddrawformat(&surface->surface_desc.u4.ddpfPixelFormat);
|
||||||
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||||
wined3d_desc.multisample_quality = 0;
|
wined3d_desc.multisample_quality = 0;
|
||||||
wined3d_desc.usage = 0;
|
wined3d_desc.usage = 0;
|
||||||
|
@ -5753,7 +5753,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
|
||||||
desc->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM;
|
desc->ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
format = PixelFormat_DD2WineD3D(&desc->u4.ddpfPixelFormat);
|
format = wined3dformat_from_ddrawformat(&desc->u4.ddpfPixelFormat);
|
||||||
if (format == WINED3DFMT_UNKNOWN)
|
if (format == WINED3DFMT_UNKNOWN)
|
||||||
{
|
{
|
||||||
WARN("Unsupported / unknown pixelformat.\n");
|
WARN("Unsupported / unknown pixelformat.\n");
|
||||||
|
|
|
@ -349,20 +349,8 @@ void PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat, enum wined3d_format_i
|
||||||
DDRAW_dump_pixelformat(DDPixelFormat);
|
DDRAW_dump_pixelformat(DDPixelFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*****************************************************************************
|
|
||||||
* PixelFormat_DD2WineD3D
|
enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *DDPixelFormat)
|
||||||
*
|
|
||||||
* Reads a DDPIXELFORMAT structure and returns the equivalent wined3d
|
|
||||||
* format ID.
|
|
||||||
*
|
|
||||||
* Params:
|
|
||||||
* DDPixelFormat: The source format
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* The wined3d format ID equivalent to the DDraw format
|
|
||||||
* WINED3DFMT_UNKNOWN if a matching format wasn't found
|
|
||||||
*****************************************************************************/
|
|
||||||
enum wined3d_format_id PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
|
|
||||||
{
|
{
|
||||||
TRACE("Convert a DirectDraw Pixelformat to a WineD3D Pixelformat\n");
|
TRACE("Convert a DirectDraw Pixelformat to a WineD3D Pixelformat\n");
|
||||||
if(TRACE_ON(ddraw))
|
if(TRACE_ON(ddraw))
|
||||||
|
|
Loading…
Reference in New Issue