Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ddraw/ddraw_private.h | 9 +++++++++ dlls/ddraw/device.c | 4 ++-- dlls/ddraw/surface.c | 10 +++++----- 3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 1c28e081b8a..0c65b9940ba 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -699,6 +699,15 @@ static inline struct wined3d_texture *ddraw_surface_get_draw_texture(struct ddra return surface->draw_texture; }
+static inline struct wined3d_texture *ddraw_surface_get_any_texture(struct ddraw_surface *surface, unsigned int flags) +{ + if (surface->texture_location & DDRAW_SURFACE_LOCATION_DEFAULT) + return ddraw_surface_get_default_texture(surface, flags); + + assert(surface->texture_location & DDRAW_SURFACE_LOCATION_DRAW); + return ddraw_surface_get_draw_texture(surface, flags); +} + void d3d_device_sync_surfaces(struct d3d_device *device) DECLSPEC_HIDDEN;
/* Used for generic dumping */ diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index b2392f54b01..c99eafc7524 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -6171,9 +6171,9 @@ static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *d UINT src_h = src_rect.bottom - src_rect.top; RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h};
- if (FAILED(hr = wined3d_texture_blt(ddraw_surface_get_default_texture(dst_level, DDRAW_SURFACE_RW), + if (FAILED(hr = wined3d_texture_blt(ddraw_surface_get_any_texture(dst_level, DDRAW_SURFACE_RW), dst_level->sub_resource_idx, &dst_rect, - ddraw_surface_get_default_texture(src_level, DDRAW_SURFACE_READ), + ddraw_surface_get_any_texture(src_level, DDRAW_SURFACE_READ), src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) ERR("Blit failed, hr %#x.\n", hr);
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index c93188aae2f..f78368a1970 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -113,7 +113,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, dst_texture = ddraw->wined3d_frontbuffer;
if (SUCCEEDED(hr = wined3d_texture_blt(dst_texture, 0, rect, - ddraw_surface_get_default_texture(surface, DDRAW_SURFACE_READ), surface->sub_resource_idx, rect, 0, + ddraw_surface_get_any_texture(surface, DDRAW_SURFACE_READ), surface->sub_resource_idx, rect, 0, NULL, WINED3D_TEXF_POINT)) && swap_interval) { hr = wined3d_swapchain_present(ddraw->wined3d_swapchain, rect, rect, NULL, swap_interval, 0); @@ -1557,8 +1557,8 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT * if (!(flags & DDBLT_ASYNC)) wined3d_flags |= WINED3D_BLT_SYNCHRONOUS;
- return wined3d_texture_blt(ddraw_surface_get_default_texture(dst_surface, DDRAW_SURFACE_RW), - dst_surface->sub_resource_idx, dst_rect, ddraw_surface_get_default_texture(src_surface, DDRAW_SURFACE_READ), + return wined3d_texture_blt(ddraw_surface_get_any_texture(dst_surface, DDRAW_SURFACE_RW), + dst_surface->sub_resource_idx, dst_rect, ddraw_surface_get_any_texture(src_surface, DDRAW_SURFACE_READ), src_surface->sub_resource_idx, src_rect, wined3d_flags, fx, filter); }
@@ -4406,8 +4406,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_BltFast(IDirectDrawSurfac if (src_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) hr = ddraw_surface_update_frontbuffer(src_impl, src_rect, TRUE, 0); if (SUCCEEDED(hr)) - hr = wined3d_texture_blt(ddraw_surface_get_default_texture(dst_impl, DDRAW_SURFACE_RW), - dst_impl->sub_resource_idx, &dst_rect, ddraw_surface_get_default_texture(src_impl,DDRAW_SURFACE_READ), + hr = wined3d_texture_blt(ddraw_surface_get_any_texture(dst_impl, DDRAW_SURFACE_RW), + dst_impl->sub_resource_idx, &dst_rect, ddraw_surface_get_any_texture(src_impl,DDRAW_SURFACE_READ), src_impl->sub_resource_idx, src_rect, flags, NULL, WINED3D_TEXF_POINT); if (SUCCEEDED(hr) && (dst_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) hr = ddraw_surface_update_frontbuffer(dst_impl, &dst_rect, FALSE, 0);