wined3d: Get rid of wined3d_surface_set_format().
This commit is contained in:
parent
afb64506ba
commit
a206f43648
|
@ -932,6 +932,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface,
|
||||||
struct wined3d_resource_desc wined3d_desc;
|
struct wined3d_resource_desc wined3d_desc;
|
||||||
struct wined3d_resource *wined3d_resource;
|
struct wined3d_resource *wined3d_resource;
|
||||||
UINT src_w, src_h;
|
UINT src_w, src_h;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
|
TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
|
||||||
iface, pSourceSurface, pSourceRects, cRects, pDestinationSurface, pDestPoints);
|
iface, pSourceSurface, pSourceRects, cRects, pDestinationSurface, pDestPoints);
|
||||||
|
@ -961,7 +962,13 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface,
|
||||||
else if (WINED3DFMT_UNKNOWN == destFormat)
|
else if (WINED3DFMT_UNKNOWN == destFormat)
|
||||||
{
|
{
|
||||||
TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", iface);
|
TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", iface);
|
||||||
wined3d_surface_set_format(Dest->wined3d_surface, srcFormat);
|
if (FAILED(hr = wined3d_surface_update_desc(Dest->wined3d_surface, wined3d_desc.width, wined3d_desc.height,
|
||||||
|
srcFormat, wined3d_desc.multisample_type, wined3d_desc.multisample_quality)))
|
||||||
|
{
|
||||||
|
WARN("Failed to update surface desc, hr %#x.\n", hr);
|
||||||
|
wined3d_mutex_unlock();
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Quick if complete copy ... */
|
/* Quick if complete copy ... */
|
||||||
|
|
|
@ -3378,30 +3378,6 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CDECL wined3d_surface_set_format(struct wined3d_surface *surface, enum wined3d_format_id format_id)
|
|
||||||
{
|
|
||||||
const struct wined3d_format *format = wined3d_get_format(&surface->resource.device->adapter->gl_info, format_id);
|
|
||||||
|
|
||||||
TRACE("surface %p, format %s.\n", surface, debug_d3dformat(format_id));
|
|
||||||
|
|
||||||
if (surface->resource.format->id != WINED3DFMT_UNKNOWN)
|
|
||||||
{
|
|
||||||
FIXME("The format of the surface must be WINED3DFORMAT_UNKNOWN.\n");
|
|
||||||
return WINED3DERR_INVALIDCALL;
|
|
||||||
}
|
|
||||||
|
|
||||||
surface->resource.size = wined3d_format_calculate_size(format, surface->resource.device->surface_alignment,
|
|
||||||
surface->pow2Width, surface->pow2Height);
|
|
||||||
surface->flags |= (WINED3DFMT_D16_LOCKABLE == format_id) ? SFLAG_LOCKABLE : 0;
|
|
||||||
surface->resource.format = format;
|
|
||||||
|
|
||||||
TRACE("size %u, byte_count %u\n", surface->resource.size, format->byte_count);
|
|
||||||
TRACE("glFormat %#x, glInternal %#x, glType %#x.\n",
|
|
||||||
format->glFormat, format->glInternal, format->glType);
|
|
||||||
|
|
||||||
return WINED3D_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void convert_r32_float_r16_float(const BYTE *src, BYTE *dst,
|
static void convert_r32_float_r16_float(const BYTE *src, BYTE *dst,
|
||||||
DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
|
DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
|
||||||
{
|
{
|
||||||
|
|
|
@ -211,7 +211,6 @@
|
||||||
@ cdecl wined3d_surface_releasedc(ptr ptr)
|
@ cdecl wined3d_surface_releasedc(ptr ptr)
|
||||||
@ cdecl wined3d_surface_restore(ptr)
|
@ cdecl wined3d_surface_restore(ptr)
|
||||||
@ cdecl wined3d_surface_set_color_key(ptr long ptr)
|
@ cdecl wined3d_surface_set_color_key(ptr long ptr)
|
||||||
@ cdecl wined3d_surface_set_format(ptr long)
|
|
||||||
@ cdecl wined3d_surface_set_mem(ptr ptr)
|
@ cdecl wined3d_surface_set_mem(ptr ptr)
|
||||||
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
|
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
|
||||||
@ cdecl wined3d_surface_set_palette(ptr ptr)
|
@ cdecl wined3d_surface_set_palette(ptr ptr)
|
||||||
|
|
|
@ -2328,7 +2328,6 @@ HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC d
|
||||||
HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface);
|
HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface);
|
||||||
HRESULT __cdecl wined3d_surface_set_color_key(struct wined3d_surface *surface,
|
HRESULT __cdecl wined3d_surface_set_color_key(struct wined3d_surface *surface,
|
||||||
DWORD flags, const struct wined3d_color_key *color_key);
|
DWORD flags, const struct wined3d_color_key *color_key);
|
||||||
HRESULT __cdecl wined3d_surface_set_format(struct wined3d_surface *surface, enum wined3d_format_id format_id);
|
|
||||||
HRESULT __cdecl wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem);
|
HRESULT __cdecl wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem);
|
||||||
HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y);
|
HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y);
|
||||||
HRESULT __cdecl wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette);
|
HRESULT __cdecl wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette);
|
||||||
|
|
Loading…
Reference in New Issue