ddraw: Add DDBLT_DEPTHFILL validation.
This commit is contained in:
parent
1d8e92c170
commit
a84980168c
|
@ -1537,26 +1537,36 @@ static HRESULT WINAPI ddraw_surface7_Blt(IDirectDrawSurface7 *iface, RECT *DestR
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
|
|
||||||
if (Flags & DDBLT_COLORFILL)
|
if (Flags & (DDBLT_COLORFILL | DDBLT_DEPTHFILL))
|
||||||
{
|
{
|
||||||
if (src_surface)
|
if (src_surface)
|
||||||
{
|
{
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
WARN("DDBLT_COLORFILL is not compatible with source surfaces, returning DDERR_INVALIDPARAMS\n");
|
WARN("Depth or colorfill is not compatible with source surfaces, returning DDERR_INVALIDPARAMS\n");
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
if (!DDBltFx)
|
if (!DDBltFx)
|
||||||
{
|
{
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
WARN("DDBLT_COLORFILL used with DDBltFx = NULL, returning DDERR_INVALIDPARAMS.\n");
|
WARN("Depth or colorfill used with DDBltFx = NULL, returning DDERR_INVALIDPARAMS.\n");
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
if (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
|
|
||||||
|
if ((Flags & (DDBLT_COLORFILL | DDBLT_DEPTHFILL)) == (DDBLT_COLORFILL | DDBLT_DEPTHFILL))
|
||||||
|
Flags &= ~DDBLT_DEPTHFILL;
|
||||||
|
|
||||||
|
if ((dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && (Flags & DDBLT_COLORFILL))
|
||||||
{
|
{
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
WARN("DDBLT_COLORFILL used on a depth buffer, returning DDERR_INVALIDPARAMS.\n");
|
WARN("DDBLT_COLORFILL used on a depth buffer, returning DDERR_INVALIDPARAMS.\n");
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
|
if (!(dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && (Flags & DDBLT_DEPTHFILL))
|
||||||
|
{
|
||||||
|
wined3d_mutex_unlock();
|
||||||
|
WARN("DDBLT_DEPTHFILL used on a color buffer, returning DDERR_INVALIDPARAMS.\n");
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Flags & DDBLT_KEYSRC && (!src_surface || !(src_surface->surface_desc.dwFlags & DDSD_CKSRCBLT)))
|
if (Flags & DDBLT_KEYSRC && (!src_surface || !(src_surface->surface_desc.dwFlags & DDSD_CKSRCBLT)))
|
||||||
|
|
Loading…
Reference in New Issue