[PATCH 3/5] ddraw: Change surface pitch before width.

Stefan Dösinger stefan at codeweavers.com
Fri Dec 13 05:30:14 CST 2013


---
 dlls/ddraw/surface.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 96f6950..2658153 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -4398,6 +4398,23 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
         format_id = wined3dformat_from_ddrawformat(&This->surface_desc.u4.ddpfPixelFormat);
     }
 
+    if (DDSD->dwFlags & DDSD_LPSURFACE && DDSD->lpSurface)
+    {
+        if (FAILED(hr = wined3d_surface_set_mem(This->wined3d_surface, DDSD->lpSurface, pitch)))
+        {
+            /* No need for a trace here, wined3d does that for us */
+            switch(hr)
+            {
+                case WINED3DERR_INVALIDCALL:
+                    wined3d_mutex_unlock();
+                    return DDERR_INVALIDPARAMS;
+                default:
+                    break; /* Go on */
+            }
+        }
+        /* DDSD->lpSurface is set by Lock() */
+    }
+
     if (update_wined3d)
     {
         if (FAILED(hr = wined3d_surface_update_desc(This->wined3d_surface, width, height,
@@ -4418,23 +4435,6 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
             This->surface_desc.u4.ddpfPixelFormat = DDSD->u4.ddpfPixelFormat;
     }
 
-    if (DDSD->dwFlags & DDSD_LPSURFACE && DDSD->lpSurface)
-    {
-        if (FAILED(hr = wined3d_surface_set_mem(This->wined3d_surface, DDSD->lpSurface, pitch)))
-        {
-            /* No need for a trace here, wined3d does that for us */
-            switch(hr)
-            {
-                case WINED3DERR_INVALIDCALL:
-                    wined3d_mutex_unlock();
-                    return DDERR_INVALIDPARAMS;
-                default:
-                    break; /* Go on */
-            }
-        }
-        /* DDSD->lpSurface is set by Lock() */
-    }
-
     wined3d_mutex_unlock();
 
     return DD_OK;
-- 
1.8.3.2




More information about the wine-patches mailing list