From d91a413ade2fd1de9bb2a44ecff13edf76c4ca98 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 17 Jan 2011 18:49:31 +0100 Subject: [PATCH] wined3d: Store an IWineD3DClipperImpl pointer in IWineD3DSurfaceImpl. --- dlls/wined3d/surface.c | 6 +++--- dlls/wined3d/surface_base.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 8eedb90b071..7e19a02387e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3507,16 +3507,16 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *dst_surface, } /* Destination must be full surface or match the clipping rectangle */ - if (dst_surface->clipper && ((IWineD3DClipperImpl *)dst_surface->clipper)->hWnd) + if (dst_surface->clipper && dst_surface->clipper->hWnd) { RECT cliprect; POINT pos[2]; - GetClientRect(((IWineD3DClipperImpl *)dst_surface->clipper)->hWnd, &cliprect); + GetClientRect(dst_surface->clipper->hWnd, &cliprect); pos[0].x = dst_rect.left; pos[0].y = dst_rect.top; pos[1].x = dst_rect.right; pos[1].y = dst_rect.bottom; - MapWindowPoints(GetDesktopWindow(), ((IWineD3DClipperImpl *)dst_surface->clipper)->hWnd, pos, 2); + MapWindowPoints(GetDesktopWindow(), dst_surface->clipper->hWnd, pos, 2); if(pos[0].x != cliprect.left || pos[0].y != cliprect.top || pos[1].x != cliprect.right || pos[1].y != cliprect.bottom) diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c index ae0643e6dbe..4449bf03d73 100644 --- a/dlls/wined3d/surface_base.c +++ b/dlls/wined3d/surface_base.c @@ -471,7 +471,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; TRACE("(%p)->(%p)\n", This, clipper); - This->clipper = clipper; + This->clipper = (IWineD3DClipperImpl *)clipper; return WINED3D_OK; } @@ -480,10 +480,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; TRACE("(%p)->(%p)\n", This, clipper); - *clipper = This->clipper; - if(*clipper) { + *clipper = (IWineD3DClipper *)This->clipper; + if (*clipper) IWineD3DClipper_AddRef(*clipper); - } + return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 65db699a3bb..b1202f31cf4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2140,7 +2140,7 @@ struct IWineD3DSurfaceImpl SIZE ds_current_size; /* DirectDraw clippers */ - IWineD3DClipper *clipper; + struct IWineD3DClipperImpl *clipper; /* DirectDraw Overlay handling */ RECT overlay_srcrect; -- 2.11.4.GIT