From 128e6b5975b6837b0a2605cbd857d04d4a2b7ae6 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 3 May 2016 21:48:05 +0200 Subject: [PATCH] wined3d: Use IsRectEmpty() instead of open coding it. Signed-off-by: Michael Stefaniuc Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/surface.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index c3c028c64e5..e0d7c807f5d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1147,8 +1147,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_texture_get_level_height(src_texture, src_surface->texture_level)); src_rect = &r; } - else if (src_rect->left < 0 || src_rect->left >= src_rect->right - || src_rect->top < 0 || src_rect->top >= src_rect->bottom) + else if (src_rect->left < 0 || src_rect->top < 0 || IsRectEmpty(src_rect)) { WARN("Invalid source rectangle.\n"); return WINED3DERR_INVALIDCALL; @@ -4032,8 +4031,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst dst_w = wined3d_texture_get_level_width(dst_texture, dst_surface->texture_level); dst_h = wined3d_texture_get_level_height(dst_texture, dst_surface->texture_level); - if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom - || dst_rect->left > dst_w || dst_rect->left < 0 + if (IsRectEmpty(dst_rect) || dst_rect->left > dst_w || dst_rect->left < 0 || dst_rect->top > dst_h || dst_rect->top < 0 || dst_rect->right > dst_w || dst_rect->right < 0 || dst_rect->bottom > dst_h || dst_rect->bottom < 0) @@ -4046,8 +4044,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst { src_w = wined3d_texture_get_level_width(src_texture, src_surface->texture_level); src_h = wined3d_texture_get_level_height(src_texture, src_surface->texture_level); - if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom - || src_rect->left > src_w || src_rect->left < 0 + if (IsRectEmpty(src_rect) || src_rect->left > src_w || src_rect->left < 0 || src_rect->top > src_h || src_rect->top < 0 || src_rect->right > src_w || src_rect->right < 0 || src_rect->bottom > src_h || src_rect->bottom < 0)