Henri Verbeet : ddraw: Ignore unsupported blit flags.

Alexandre Julliard julliard at winehq.org
Fri Oct 20 07:19:57 CDT 2017


Module: wine
Branch: stable
Commit: bcaf945ed2f1e4d0ba2b4e0f53ab2c42d796575d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bcaf945ed2f1e4d0ba2b4e0f53ab2c42d796575d

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Apr 24 23:31:30 2017 +0200

ddraw: Ignore unsupported blit flags.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 6b41501344ecedf12692902f08aada283847e8cd)
Conflicts:
	dlls/ddraw/surface.c
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ddraw/surface.c      | 24 +++++++++++++++++++++---
 dlls/ddraw/tests/ddraw1.c |  4 ++--
 dlls/ddraw/tests/ddraw2.c |  4 ++--
 dlls/ddraw/tests/ddraw4.c |  4 ++--
 dlls/ddraw/tests/ddraw7.c |  4 ++--
 5 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 94f850b..0c8081d 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -1547,15 +1547,33 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Blt(IDirectDrawSurface7 *
     struct ddraw_surface *dst_impl = impl_from_IDirectDrawSurface7(iface);
     struct ddraw_surface *src_impl = unsafe_impl_from_IDirectDrawSurface7(src_surface);
     struct wined3d_blt_fx wined3d_fx;
+    DWORD unsupported_flags;
     HRESULT hr = DD_OK;
     DDBLTFX rop_fx;
 
     TRACE("iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.\n",
             iface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), flags, fx);
 
-    /* Check for validity of the flags here. WineD3D Has the software-opengl selection path and would have
-     * to check at 2 places, and sometimes do double checks. This also saves the call to wined3d :-)
-     */
+    unsupported_flags = DDBLT_ALPHADEST
+            | DDBLT_ALPHADESTCONSTOVERRIDE
+            | DDBLT_ALPHADESTNEG
+            | DDBLT_ALPHADESTSURFACEOVERRIDE
+            | DDBLT_ALPHAEDGEBLEND
+            | DDBLT_ALPHASRC
+            | DDBLT_ALPHASRCCONSTOVERRIDE
+            | DDBLT_ALPHASRCNEG
+            | DDBLT_ALPHASRCSURFACEOVERRIDE
+            | DDBLT_ZBUFFER
+            | DDBLT_ZBUFFERDESTCONSTOVERRIDE
+            | DDBLT_ZBUFFERDESTOVERRIDE
+            | DDBLT_ZBUFFERSRCCONSTOVERRIDE
+            | DDBLT_ZBUFFERSRCOVERRIDE;
+    if (flags & unsupported_flags)
+    {
+        WARN("Ignoring unsupported flags %#x.\n", flags & unsupported_flags);
+        flags &= ~unsupported_flags;
+    }
+
     if ((flags & DDBLT_KEYSRCOVERRIDE) && (!fx || flags & DDBLT_KEYSRC))
     {
         WARN("Invalid source color key parameters, returning DDERR_INVALIDPARAMS\n");
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 999547d..a09570c 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -8867,10 +8867,10 @@ static void test_blt_z_alpha(void)
         ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         hr = IDirectDrawSurface_Blt(dst_surface, NULL, src_surface, NULL, blt_flags[i] | DDBLT_WAIT, &fx);
-        todo_wine ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         color = get_surface_color(dst_surface, 32, 32);
-        todo_wine ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
+        ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
     }
 
     IDirectDrawSurface_Release(dst_surface);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 1acaa96..bc3f345 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -9955,10 +9955,10 @@ static void test_blt_z_alpha(void)
         ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         hr = IDirectDrawSurface_Blt(dst_surface, NULL, src_surface, NULL, blt_flags[i] | DDBLT_WAIT, &fx);
-        todo_wine ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         color = get_surface_color(dst_surface, 32, 32);
-        todo_wine ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
+        ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
     }
 
     IDirectDrawSurface_Release(dst_surface);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 557de42..9314ca1 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -11076,10 +11076,10 @@ static void test_blt_z_alpha(void)
         ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         hr = IDirectDrawSurface4_Blt(dst_surface, NULL, src_surface, NULL, blt_flags[i] | DDBLT_WAIT, &fx);
-        todo_wine ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         color = get_surface_color(dst_surface, 32, 32);
-        todo_wine ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
+        ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
     }
 
     IDirectDrawSurface4_Release(dst_surface);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index a800629..43ba419 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -11402,10 +11402,10 @@ static void test_blt_z_alpha(void)
         ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         hr = IDirectDrawSurface7_Blt(dst_surface, NULL, src_surface, NULL, blt_flags[i] | DDBLT_WAIT, &fx);
-        todo_wine ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
+        ok(SUCCEEDED(hr), "Test %u: Got unexpected hr %#x.\n", i, hr);
 
         color = get_surface_color(dst_surface, 32, 32);
-        todo_wine ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
+        ok(compare_color(color, 0x0000ff00, 0), "Test %u: Got unexpected color 0x%08x.\n", i, color);
     }
 
     IDirectDrawSurface7_Release(dst_surface);




More information about the wine-cvs mailing list