Commit 3139249a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Move the primary surface validation from CreateSurface() to ddraw_surface_create_texture().

parent 2105b449
......@@ -2863,12 +2863,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
return DDERR_NOEXCLUSIVEMODE;
}
if((DDSD->ddsCaps.dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE)) == (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
{
WARN("Application wanted to create back buffer primary surface\n");
return DDERR_INVALIDCAPS;
}
/* Modify some flags */
copy_to_surfacedesc2(&desc2, DDSD);
......
......@@ -5608,6 +5608,13 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
DDRAW_dump_surface_desc(desc);
}
if ((desc->ddsCaps.dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
== (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
{
WARN("Tried to create a back buffer surface.\n");
return DDERR_INVALIDCAPS;
}
/* This is a special case in ddrawex, but not allowed in ddraw. */
if ((desc->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
== (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
......
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