If a FOURCC surface specifies DDSD_PITCH, use that instead of

dwLinearSize.
This commit is contained in:
Matthew Mastracci 2005-03-21 10:28:09 +00:00 committed by Alexandre Julliard
parent 3e7c8e78dc
commit 9eead12471
1 changed files with 2 additions and 1 deletions

View File

@ -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;