Commit 128e6b59 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wined3d: Use IsRectEmpty() instead of open coding it.

parent ecb5a74b
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment