From: Matthew Mastracci Date: Mon, 21 Mar 2005 10:28:09 +0000 (+0000) Subject: If a FOURCC surface specifies DDSD_PITCH, use that instead of X-Git-Tag: wine-20050419~396 X-Git-Url: http://git.etersoft.ru/projects/?a=commitdiff_plain;h=9eead12471697f13a770b7a596882358863c66c4;p=wine%2Feterwine.git If a FOURCC surface specifies DDSD_PITCH, use that instead of dwLinearSize. --- diff --git a/dlls/ddraw/dsurface/dib.c b/dlls/ddraw/dsurface/dib.c index c0eafd44f5..b462c66859 100644 --- a/dlls/ddraw/dsurface/dib.c +++ b/dlls/ddraw/dsurface/dib.c @@ -255,7 +255,8 @@ HRESULT DIB_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl *This, 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;