Commit 06f393dc authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Move the DDSD_LPSURFACE fixups from CreateSurface() to ddraw_surface_create_texture().

parent f2e98544
......@@ -2842,19 +2842,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
DDSD->dwFlags |= DDSD_CAPS;
}
if (DDSD->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD)
{
/* If the surface is of the 'alloconload' type, ignore the LPSURFACE field */
DDSD->dwFlags &= ~DDSD_LPSURFACE;
}
if ((DDSD->dwFlags & DDSD_LPSURFACE) && (DDSD->lpSurface == NULL))
{
/* Frank Herbert's Dune specifies a null pointer for the surface, ignore the LPSURFACE field */
WARN("(%p) Null surface pointer specified, ignore it!\n", ddraw);
DDSD->dwFlags &= ~DDSD_LPSURFACE;
}
/* Modify some flags */
copy_to_surfacedesc2(&desc2, DDSD);
......
......@@ -5608,6 +5608,11 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
DDRAW_dump_surface_desc(desc);
}
/* 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)
desc->dwFlags &= ~DDSD_LPSURFACE;
if ((desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE))
== (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE)
&& !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment