[PATCH 5/5] ddraw: Move the flippable validation from CreateSurface() to ddraw_surface_create_texture().

Henri Verbeet hverbeet at codeweavers.com
Wed Nov 27 04:04:52 CST 2013


---
 dlls/ddraw/ddraw.c   |    8 --------
 dlls/ddraw/surface.c |    8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 109d745..415eda0 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2855,14 +2855,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
         DDSD->dwFlags &= ~DDSD_LPSURFACE;
     }
 
-    if ((DDSD->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE))
-            == (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE)
-            && !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
-    {
-        WARN("Attempted to create a flipable primary surface without DDSCL_EXCLUSIVE.\n");
-        return DDERR_NOEXCLUSIVEMODE;
-    }
-
     /* Modify some flags */
     copy_to_surfacedesc2(&desc2, DDSD);
 
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index ebbd6c1..4c5021d 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5608,6 +5608,14 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
         DDRAW_dump_surface_desc(desc);
     }
 
+    if ((desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE))
+            == (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE)
+            && !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
+    {
+        WARN("Tried to create a flippable primary surface without DDSCL_EXCLUSIVE.\n");
+        return DDERR_NOEXCLUSIVEMODE;
+    }
+
     if ((desc->ddsCaps.dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
             == (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
     {
-- 
1.7.10.4




More information about the wine-patches mailing list