From c48ff6c12a35703a3c982ca2db40870c4639bab4 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 20 May 2010 09:12:19 +0200 Subject: [PATCH] wined3d: Split checking for "empty" source and destination rectangles in IWineD3DBaseSurfaceImpl_Blt(). Assuming this is supposed to check for empty source / destination rectangles, the check doesn't look quite right to me. I'm going to leave that alone for the time being though. --- dlls/wined3d/surface_base.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c index 9778c81d237..43642de8758 100644 --- a/dlls/wined3d/surface_base.c +++ b/dlls/wined3d/surface_base.c @@ -1020,21 +1020,24 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D return WINEDDERR_INVALIDRECT; } - /* Now handle negative values in the rectangles. Warning: only supported for now - in the 'simple' cases (ie not in any stretching / rotation cases). + /* Now handle negative values in the rectangles. Warning: only supported + * for now in the 'simple' cases (ie not in any stretching / rotation + * cases). First, the case where nothing is to be done. */ - First, the case where nothing is to be done. - */ - if ((DestRect && ((DestRect->bottom <= 0) || (DestRect->right <= 0) || - (DestRect->top >= (int) This->currentDesc.Height) || - (DestRect->left >= (int) This->currentDesc.Width))) || - ((Src != NULL) && (SrcRect != NULL) && - ((SrcRect->bottom <= 0) || (SrcRect->right <= 0) || - (SrcRect->top >= (int) Src->currentDesc.Height) || - (SrcRect->left >= (int) Src->currentDesc.Width)) )) + if (DestRect && (DestRect->bottom <= 0 || DestRect->right <= 0 + || DestRect->top >= (int)This->currentDesc.Height + || DestRect->left >= (int)This->currentDesc.Width)) { - TRACE("Nothing to be done !\n"); - return WINED3D_OK; + TRACE("Nothing to be done.\n"); + return WINED3D_OK; + } + + if (Src && SrcRect && (SrcRect->bottom <= 0 || SrcRect->right <= 0 + || SrcRect->top >= (int)Src->currentDesc.Height + || SrcRect->left >= (int)Src->currentDesc.Width)) + { + TRACE("Nothing to be done.\n"); + return WINED3D_OK; } if (DestRect)