Henri Verbeet : ddraw: Only update primary_lock when we' re actually locking the frontbuffer.

Alexandre Julliard julliard at winehq.org
Thu Oct 27 13:30:13 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Oct 27 17:06:24 2011 +0200

ddraw: Only update primary_lock when we're actually locking the frontbuffer.

This fixes a regression introduced by commit
8330558e125c9073068ffbd7741f1128c17c1e08.

---

 dlls/ddraw/surface.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index de32103..9f85153 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -972,12 +972,15 @@ static HRESULT surface_lock(IDirectDrawSurfaceImpl *This,
         }
     }
 
-    if (Flags & DDLOCK_READONLY)
-        memset(&This->ddraw->primary_lock, 0, sizeof(This->ddraw->primary_lock));
-    else if (Rect)
-        This->ddraw->primary_lock = *Rect;
-    else
-        SetRect(&This->ddraw->primary_lock, 0, 0, This->surface_desc.dwWidth, This->surface_desc.dwHeight);
+    if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
+    {
+        if (Flags & DDLOCK_READONLY)
+            memset(&This->ddraw->primary_lock, 0, sizeof(This->ddraw->primary_lock));
+        else if (Rect)
+            This->ddraw->primary_lock = *Rect;
+        else
+            SetRect(&This->ddraw->primary_lock, 0, 0, This->surface_desc.dwWidth, This->surface_desc.dwHeight);
+    }
 
     /* Override the memory area. The pitch should be set already. Strangely windows
      * does not set the LPSURFACE flag on locked surfaces !?!.




More information about the wine-cvs mailing list