Commit 33d182dd authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Reject creating DDSCAPS_VIDEOMEMORY surfaces with DDRAW_NO3D.

parent 9efa178e
......@@ -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;
......
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