ddraw: Reject creating DDSCAPS_VIDEOMEMORY surfaces with DDRAW_NO3D.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Henri Verbeet 2018-09-25 01:55:20 +03:30 committed by Alexandre Julliard
parent 9efa178ee6
commit 33d182dd54
1 changed files with 10 additions and 2 deletions

View File

@ -6122,8 +6122,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
usage = WINED3DUSAGE_RENDERTARGET;
if (SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
WINED3D_DEVICE_TYPE_HAL, mode.format_id, usage, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
if (!(ddraw->flags & DDRAW_NO3D) && SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d,
WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, mode.format_id,
usage, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
desc->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
else
desc->ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
@ -6257,6 +6258,13 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return DDERR_NOCOLORKEYHW;
}
if ((ddraw->flags & DDRAW_NO3D) && (desc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
{
WARN("Video memory surfaces not supported without 3D support.\n");
heap_free(texture);
return DDERR_NODIRECTDRAWHW;
}
if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY))
wined3d_desc.usage |= WINED3DUSAGE_OVERLAY;