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>
This commit is contained in:
parent
9efa178ee6
commit
33d182dd54
@ -6122,8 +6122,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
|||||||
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|
||||||
usage = WINED3DUSAGE_RENDERTARGET;
|
usage = WINED3DUSAGE_RENDERTARGET;
|
||||||
|
|
||||||
if (SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
|
if (!(ddraw->flags & DDRAW_NO3D) && SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d,
|
||||||
WINED3D_DEVICE_TYPE_HAL, mode.format_id, usage, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
|
WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, mode.format_id,
|
||||||
|
usage, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
|
||||||
desc->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
|
desc->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
|
||||||
else
|
else
|
||||||
desc->ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
desc->ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
||||||
@ -6257,6 +6258,13 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
|||||||
return DDERR_NOCOLORKEYHW;
|
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))
|
if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY))
|
||||||
wined3d_desc.usage |= WINED3DUSAGE_OVERLAY;
|
wined3d_desc.usage |= WINED3DUSAGE_OVERLAY;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user