From a91f844a3d1c8e4f37b9d31f0025f3d20d1bbcb2 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Thu, 25 Mar 2010 23:23:12 +0100 Subject: [PATCH] wined3d: Use RECT instead of WINED3DRECT in more parts of BltOverride. --- dlls/wined3d/surface.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index b67672ecd8d..9d1e8047981 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3769,6 +3769,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const WINED3DRECT rect; IWineD3DSwapChainImpl *srcSwapchain = NULL, *dstSwapchain = NULL; IWineD3DSurfaceImpl *Src = (IWineD3DSurfaceImpl *) SrcSurface; + RECT dst_rect; TRACE("(%p)->(%p,%p,%p,%08x,%p)\n", This, DestRect, SrcSurface, SrcRect, Flags, DDBltFx); @@ -3813,6 +3814,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const rect.x2 = This->currentDesc.Width; rect.y2 = This->currentDesc.Height; } + surface_get_rect(This, DestRect, &dst_rect); /* The only case where both surfaces on a swapchain are supported is a back buffer -> front buffer blit on the same swapchain */ if(dstSwapchain && dstSwapchain == srcSwapchain && dstSwapchain->backBuffer && @@ -4108,9 +4110,9 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const ClientToScreen(context->win_handle, &offset); GetClientRect(context->win_handle, &windowsize); h = windowsize.bottom - windowsize.top; - rect.x1 -= offset.x; rect.x2 -=offset.x; - rect.y1 -= offset.y; rect.y2 -=offset.y; - rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h; + dst_rect.left -= offset.x; dst_rect.right -=offset.x; + dst_rect.top -= offset.y; dst_rect.bottom -=offset.y; + dst_rect.top += This->currentDesc.Height - h; dst_rect.bottom += This->currentDesc.Height - h; } if (!is_identity_fixup(This->resource.format_desc->color_fixup)) @@ -4152,7 +4154,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const /* Draw a textured quad */ - draw_textured_quad(Src, &SourceRectangle, (RECT*)&rect, Filter); + draw_textured_quad(Src, &SourceRectangle, &dst_rect, Filter); if(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) { glDisable(GL_ALPHA_TEST); @@ -4205,10 +4207,10 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const !(This == (IWineD3DSurfaceImpl*) dstSwapchain->frontBuffer || (dstSwapchain->backBuffer && This == (IWineD3DSurfaceImpl*) dstSwapchain->backBuffer[0]))) { TRACE("Surface is higher back buffer, falling back to software\n"); - return cpu_blit.color_fill(myDevice, This, (RECT*)&rect, color); + return cpu_blit.color_fill(myDevice, This, &dst_rect, color); } - return ffp_blit.color_fill(myDevice, This, (RECT*)&rect, color); + return ffp_blit.color_fill(myDevice, This, &dst_rect, color); } }