Commit 1a812eb6 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Use wined3d_texture_blt() in ddraw_surface_blt_clipped().

parent 45b33347
...@@ -1389,7 +1389,8 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons ...@@ -1389,7 +1389,8 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons
struct ddraw_surface *src_surface, const RECT *src_rect_in, DWORD flags, struct ddraw_surface *src_surface, const RECT *src_rect_in, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter)
{ {
struct wined3d_surface *wined3d_src_surface = src_surface ? src_surface->wined3d_surface : NULL; struct wined3d_texture *wined3d_src_texture;
unsigned int src_sub_resource_idx;
RECT src_rect, dst_rect; RECT src_rect, dst_rect;
float scale_x, scale_y; float scale_x, scale_y;
const RECT *clip_rect; const RECT *clip_rect;
...@@ -1429,10 +1430,15 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons ...@@ -1429,10 +1430,15 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons
if (IsRectEmpty(&src_rect)) if (IsRectEmpty(&src_rect))
return DDERR_INVALIDRECT; return DDERR_INVALIDRECT;
wined3d_src_texture = src_surface->wined3d_texture;
src_sub_resource_idx = src_surface->sub_resource_idx;
} }
else else
{ {
SetRect(&src_rect, 0, 0, 0, 0); SetRect(&src_rect, 0, 0, 0, 0);
wined3d_src_texture = NULL;
src_sub_resource_idx = 0;
} }
if (!dst_surface->clipper) if (!dst_surface->clipper)
...@@ -1440,8 +1446,8 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons ...@@ -1440,8 +1446,8 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons
if (src_surface && src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (src_surface && src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
hr = ddraw_surface_update_frontbuffer(src_surface, &src_rect, TRUE); hr = ddraw_surface_update_frontbuffer(src_surface, &src_rect, TRUE);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = wined3d_surface_blt(dst_surface->wined3d_surface, &dst_rect, hr = wined3d_texture_blt(dst_surface->wined3d_texture, dst_surface->sub_resource_idx, &dst_rect,
wined3d_src_surface, &src_rect, flags, fx, filter); wined3d_src_texture, src_sub_resource_idx, &src_rect, flags, fx, filter);
if (SUCCEEDED(hr) && (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) if (SUCCEEDED(hr) && (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
hr = ddraw_surface_update_frontbuffer(dst_surface, &dst_rect, FALSE); hr = ddraw_surface_update_frontbuffer(dst_surface, &dst_rect, FALSE);
...@@ -1491,8 +1497,8 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons ...@@ -1491,8 +1497,8 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons
} }
} }
if (FAILED(hr = wined3d_surface_blt(dst_surface->wined3d_surface, &clip_rect[i], if (FAILED(hr = wined3d_texture_blt(dst_surface->wined3d_texture, dst_surface->sub_resource_idx,
wined3d_src_surface, &src_rect_clipped, flags, fx, filter))) &clip_rect[i], wined3d_src_texture, src_sub_resource_idx, &src_rect_clipped, flags, fx, filter)))
break; break;
if (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment