Henri Verbeet : ddraw: Move the DDSD_LPSURFACE fixups from CreateSurface() to ddraw_surface_create_texture().

Alexandre Julliard julliard at winehq.org
Fri Nov 29 13:24:27 CST 2013


Module: wine
Branch: master
Commit: 06f393dc7d53397ba39a16c1f5d5a87430a86e85
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=06f393dc7d53397ba39a16c1f5d5a87430a86e85

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Nov 28 09:55:39 2013 +0100

ddraw: Move the DDSD_LPSURFACE fixups from CreateSurface() to ddraw_surface_create_texture().

---

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

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 415eda0..efdf28e 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2842,19 +2842,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
         DDSD->dwFlags |= DDSD_CAPS;
     }
 
-    if (DDSD->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD)
-    {
-        /* If the surface is of the 'alloconload' type, ignore the LPSURFACE field */
-        DDSD->dwFlags &= ~DDSD_LPSURFACE;
-    }
-
-    if ((DDSD->dwFlags & DDSD_LPSURFACE) && (DDSD->lpSurface == NULL))
-    {
-        /* Frank Herbert's Dune specifies a null pointer for the surface, ignore the LPSURFACE field */
-        WARN("(%p) Null surface pointer specified, ignore it!\n", ddraw);
-        DDSD->dwFlags &= ~DDSD_LPSURFACE;
-    }
-
     /* Modify some flags */
     copy_to_surfacedesc2(&desc2, DDSD);
 
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 4c5021d..18b23b2 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5608,6 +5608,11 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
         DDRAW_dump_surface_desc(desc);
     }
 
+    /* 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)
+        desc->dwFlags &= ~DDSD_LPSURFACE;
+
     if ((desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE))
             == (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE)
             && !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))




More information about the wine-cvs mailing list