[PATCH 2/2] ddraw/tests: Move some helper functions up with the rest of the helper functions.

Henri Verbeet hverbeet at codeweavers.com
Thu Feb 2 12:26:38 CST 2012


---
 dlls/ddraw/tests/ddraw2.c |   28 ++++++++++++++--------------
 dlls/ddraw/tests/ddraw4.c |   28 ++++++++++++++--------------
 dlls/ddraw/tests/ddraw7.c |   28 ++++++++++++++--------------
 3 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 73ae501..10c065a 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -95,6 +95,20 @@ static void destroy_window_thread(struct create_window_thread_param *p)
     CloseHandle(p->thread);
 }
 
+static IDirectDrawSurface *get_depth_stencil(IDirect3DDevice2 *device)
+{
+    IDirectDrawSurface *rt, *ret;
+    DDSCAPS caps = {DDSCAPS_ZBUFFER};
+    HRESULT hr;
+
+    hr = IDirect3DDevice2_GetRenderTarget(device, &rt);
+    ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+    hr = IDirectDrawSurface_GetAttachedSurface(rt, &caps, &ret);
+    ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr);
+    IDirectDrawSurface_Release(rt);
+    return ret;
+}
+
 static D3DCOLOR get_surface_color(IDirectDrawSurface *surface, UINT x, UINT y)
 {
     RECT rect = {x, y, x + 1, y + 1};
@@ -841,20 +855,6 @@ static void test_coop_level_threaded(void)
     destroy_window_thread(&p);
 }
 
-static IDirectDrawSurface *get_depth_stencil(IDirect3DDevice2 *device)
-{
-    IDirectDrawSurface *rt, *ret;
-    DDSCAPS caps = {DDSCAPS_ZBUFFER};
-    HRESULT hr;
-
-    hr = IDirect3DDevice2_GetRenderTarget(device, &rt);
-    ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
-    hr = IDirectDrawSurface_GetAttachedSurface(rt, &caps, &ret);
-    ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr);
-    IDirectDrawSurface_Release(rt);
-    return ret;
-}
-
 static void test_depth_blit(void)
 {
     static D3DLVERTEX quad1[] =
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 07509b9..8d80da6 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -130,6 +130,20 @@ static void destroy_window_thread(struct create_window_thread_param *p)
     CloseHandle(p->thread);
 }
 
+static IDirectDrawSurface4 *get_depth_stencil(IDirect3DDevice3 *device)
+{
+    IDirectDrawSurface4 *rt, *ret;
+    DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, 0};
+    HRESULT hr;
+
+    hr = IDirect3DDevice3_GetRenderTarget(device, &rt);
+    ok(SUCCEEDED(hr), "Failed to get the render target, hr %#x.\n", hr);
+    hr = IDirectDrawSurface4_GetAttachedSurface(rt, &caps, &ret);
+    ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr);
+    IDirectDrawSurface4_Release(rt);
+    return ret;
+}
+
 static D3DCOLOR get_surface_color(IDirectDrawSurface4 *surface, UINT x, UINT y)
 {
     RECT rect = {x, y, x + 1, y + 1};
@@ -1007,20 +1021,6 @@ static void test_coop_level_threaded(void)
     destroy_window_thread(&p);
 }
 
-static IDirectDrawSurface4 *get_depth_stencil(IDirect3DDevice3 *device)
-{
-    IDirectDrawSurface4 *rt, *ret;
-    DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, 0};
-    HRESULT hr;
-
-    hr = IDirect3DDevice3_GetRenderTarget(device, &rt);
-    ok(SUCCEEDED(hr), "Failed to get the render target, hr %#x.\n", hr);
-    hr = IDirectDrawSurface4_GetAttachedSurface(rt, &caps, &ret);
-    ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr);
-    IDirectDrawSurface4_Release(rt);
-    return ret;
-}
-
 static void test_depth_blit(void)
 {
     static struct
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index ecafcec..e542a27 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -139,6 +139,20 @@ static void destroy_window_thread(struct create_window_thread_param *p)
     CloseHandle(p->thread);
 }
 
+static IDirectDrawSurface7 *get_depth_stencil(IDirect3DDevice7 *device)
+{
+    IDirectDrawSurface7 *rt, *ret;
+    DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, 0};
+    HRESULT hr;
+
+    hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
+    ok(SUCCEEDED(hr), "Failed to get the render target, hr %#x.\n", hr);
+    hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &ret);
+    ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr);
+    IDirectDrawSurface7_Release(rt);
+    return ret;
+}
+
 static D3DCOLOR get_surface_color(IDirectDrawSurface7 *surface, UINT x, UINT y)
 {
     RECT rect = {x, y, x + 1, y + 1};
@@ -946,20 +960,6 @@ static void test_coop_level_threaded(void)
     destroy_window_thread(&p);
 }
 
-static IDirectDrawSurface7 *get_depth_stencil(IDirect3DDevice7 *device)
-{
-    IDirectDrawSurface7 *rt, *ret;
-    DDSCAPS2 caps = {DDSCAPS_ZBUFFER, 0, 0, 0};
-    HRESULT hr;
-
-    hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
-    ok(SUCCEEDED(hr), "Failed to get the render target, hr %#x.\n", hr);
-    hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &ret);
-    ok(SUCCEEDED(hr) || hr == DDERR_NOTFOUND, "Failed to get the z buffer, hr %#x.\n", hr);
-    IDirectDrawSurface7_Release(rt);
-    return ret;
-}
-
 static void test_depth_blit(void)
 {
     IDirect3DDevice7 *device;
-- 
1.7.3.4




More information about the wine-patches mailing list