Commit b3790bf8 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent 887b445b
...@@ -3975,23 +3975,15 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev ...@@ -3975,23 +3975,15 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
src_rect.left = src_box->left; SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
src_rect.top = src_box->top;
src_rect.right = src_box->right;
src_rect.bottom = src_box->bottom;
} }
else else
{ {
src_rect.left = 0; SetRect(&src_rect, 0, 0, src_surface->resource.width, src_surface->resource.height);
src_rect.top = 0;
src_rect.right = src_surface->resource.width;
src_rect.bottom = src_surface->resource.height;
} }
dst_rect.left = dst_x; SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left),
dst_rect.top = dst_y; dst_y + (src_rect.bottom - src_rect.top));
dst_rect.right = dst_x + (src_rect.right - src_rect.left);
dst_rect.bottom = dst_y + (src_rect.bottom - src_rect.top);
if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
WARN("Failed to blit, hr %#x.\n", hr); WARN("Failed to blit, hr %#x.\n", hr);
......
...@@ -1444,10 +1444,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P ...@@ -1444,10 +1444,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
if (!src_rect) if (!src_rect)
{ {
r.left = 0; SetRect(&r, 0, 0, src_surface->resource.width, src_surface->resource.height);
r.top = 0;
r.right = src_surface->resource.width;
r.bottom = src_surface->resource.height;
src_rect = &r; src_rect = &r;
} }
else if (src_rect->left < 0 || src_rect->left >= src_rect->right else if (src_rect->left < 0 || src_rect->left >= src_rect->right
......
...@@ -545,10 +545,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT ...@@ -545,10 +545,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
} }
else else
{ {
src_rect.left = 0; SetRect(&src_rect, 0, 0, swapchain->desc.backbuffer_width,
src_rect.top = 0; swapchain->desc.backbuffer_height);
src_rect.right = swapchain->desc.backbuffer_width;
src_rect.bottom = swapchain->desc.backbuffer_height;
} }
if (dst_rect_in) if (dst_rect_in)
......
...@@ -880,10 +880,7 @@ static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_reso ...@@ -880,10 +880,7 @@ static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_reso
struct wined3d_const_bo_address addr; struct wined3d_const_bo_address addr;
RECT src_rect; RECT src_rect;
src_rect.left = 0; SetRect(&src_rect, 0, 0, surface->resource.width, surface->resource.height);
src_rect.top = 0;
src_rect.right = surface->resource.width;
src_rect.bottom = surface->resource.height;
addr.buffer_object = 0; addr.buffer_object = 0;
addr.addr = data->data; addr.addr = data->data;
......
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