[PATCH 2/5] ddraw: Move the DDSD_CAPS fixup from CreateSurface() to ddraw_surface_create_texture().

Henri Verbeet hverbeet at codeweavers.com
Thu Nov 28 02:55:40 CST 2013


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

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index efdf28e..389038c 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2836,12 +2836,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
         return E_POINTER; /* unchecked */
     }
 
-    if (!(DDSD->dwFlags & DDSD_CAPS))
-    {
-        /* DVIDEO.DLL does forget the DDSD_CAPS flag ... *sigh* */
-        DDSD->dwFlags |= DDSD_CAPS;
-    }
-
     /* Modify some flags */
     copy_to_surfacedesc2(&desc2, DDSD);
 
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 18b23b2..a13a5e4 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5608,6 +5608,9 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
         DDRAW_dump_surface_desc(desc);
     }
 
+    /* Ensure DDSD_CAPS is always set. */
+    desc->dwFlags |= DDSD_CAPS;
+
     /* If the surface is of the 'ALLOCONLOAD' type, ignore the LPSURFACE
      * field. Frank Herbert's Dune specifies a NULL pointer for lpSurface. */
     if ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface)
-- 
1.7.10.4




More information about the wine-patches mailing list