ddraw: Move the DDSD_CAPS fixup from CreateSurface() to ddraw_surface_create_texture().

This commit is contained in:
Henri Verbeet 2013-11-28 09:55:40 +01:00 committed by Alexandre Julliard
parent 06f393dc7d
commit 2c109d2df1
2 changed files with 3 additions and 6 deletions

View file

@ -2836,12 +2836,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
return E_POINTER; /* unchecked */
}
if (!(DDSD->dwFlags & DDSD_CAPS))
{
/* DVIDEO.DLL does forget the DDSD_CAPS flag ... *sigh* */
DDSD->dwFlags |= DDSD_CAPS;
}
/* Modify some flags */
copy_to_surfacedesc2(&desc2, DDSD);

View file

@ -5608,6 +5608,9 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
DDRAW_dump_surface_desc(desc);
}
/* Ensure DDSD_CAPS is always set. */
desc->dwFlags |= DDSD_CAPS;
/* If the surface is of the 'ALLOCONLOAD' type, ignore the LPSURFACE
* field. Frank Herbert's Dune specifies a NULL pointer for lpSurface. */
if ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface)