Commit 080c7449 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3d9/tests: Use SetRect() instead of open coding it.

parent 88fb8850
...@@ -1990,10 +1990,7 @@ static void test_reset(void) ...@@ -1990,10 +1990,7 @@ static void test_reset(void)
ok(d3dpp.BackBufferHeight == 300, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); ok(d3dpp.BackBufferHeight == 300, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight);
IDirect3DSwapChain9_Release(swapchain); IDirect3DSwapChain9_Release(swapchain);
winrect.left = 0; SetRect(&winrect, 0, 0, 200, 150);
winrect.top = 0;
winrect.right = 200;
winrect.bottom = 150;
ok(AdjustWindowRect(&winrect, WS_OVERLAPPEDWINDOW, FALSE), "AdjustWindowRect failed\n"); ok(AdjustWindowRect(&winrect, WS_OVERLAPPEDWINDOW, FALSE), "AdjustWindowRect failed\n");
ok(SetWindowPos(hwnd, NULL, 0, 0, ok(SetWindowPos(hwnd, NULL, 0, 0,
winrect.right-winrect.left, winrect.right-winrect.left,
...@@ -8465,17 +8462,14 @@ static void test_surface_blocks(void) ...@@ -8465,17 +8462,14 @@ static void test_surface_blocks(void)
hr = IDirect3DTexture9_UnlockRect(texture, 1); hr = IDirect3DTexture9_UnlockRect(texture, 1);
ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr);
rect.left = 0; SetRect(&rect, 0, 0, formats[i].block_width == 1 ? 1 : formats[i].block_width >> 1,
rect.top = 0; formats[i].block_height == 1 ? 1 : formats[i].block_height >> 1);
rect.right = formats[i].block_width == 1 ? 1 : formats[i].block_width >> 1;
rect.bottom = formats[i].block_height == 1 ? 1 : formats[i].block_height >> 1;
hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0); hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0);
ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr);
hr = IDirect3DTexture9_UnlockRect(texture, 1); hr = IDirect3DTexture9_UnlockRect(texture, 1);
ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed lock texture, hr %#x.\n", hr);
rect.right = formats[i].block_width; SetRect(&rect, 0, 0, formats[i].block_width, formats[i].block_height);
rect.bottom = formats[i].block_height;
hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0); hr = IDirect3DTexture9_LockRect(texture, 1, &locked_rect, &rect, 0);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
......
...@@ -1041,10 +1041,7 @@ static void clear_test(void) ...@@ -1041,10 +1041,7 @@ static void clear_test(void)
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr);
scissor.left = 160; SetRect(&scissor, 160, 120, 480, 360);
scissor.right = 480;
scissor.top = 120;
scissor.bottom = 360;
hr = IDirect3DDevice9_SetScissorRect(device, &scissor); hr = IDirect3DDevice9_SetScissorRect(device, &scissor);
ok(hr == D3D_OK, "IDirect3DDevice_SetScissorRect failed with %08x\n", hr); ok(hr == D3D_OK, "IDirect3DDevice_SetScissorRect failed with %08x\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SCISSORTESTENABLE, TRUE); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SCISSORTESTENABLE, TRUE);
......
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