DDRAW: Respect DDSD_PITCH for FOURCC surfaces

Matthew Mastracci matt at aclaro.com
Sun Mar 20 10:58:06 CST 2005


This patch is necessary to handle YUV surfaces that specify both a pitch 
and a FOURCC value.

ChangeLog:
If a FOURCC surface specifies DDSD_PITCH, use that instead of dwLinearSize.
-------------- next part --------------
Index: dlls/ddraw/dsurface/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/dib.c,v
retrieving revision 1.46
diff -u -r1.46 dib.c
--- dlls/ddraw/dsurface/dib.c	10 Mar 2005 11:13:11 -0000	1.46
+++ dlls/ddraw/dsurface/dib.c	20 Mar 2005 15:40:54 -0000
@@ -255,7 +255,8 @@
 
 	This->surface_desc.dwFlags |= DDSD_LPSURFACE;
 
-	if (This->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC) {
+	/* Ensure that DDSD_PITCH is respected for DDPF_FOURCC surfaces too */
+ 	if (This->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC && !(This->surface_desc.dwFlags & DDSD_PITCH)) {
 	    This->surface_desc.lpSurface
 		= VirtualAlloc(NULL, This->surface_desc.u1.dwLinearSize, MEM_COMMIT, PAGE_READWRITE);
 	    This->surface_desc.dwFlags |= DDSD_LINEARSIZE;


More information about the wine-patches mailing list