Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/ddraw/surface.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index cf09f9c1416..c51db7661ab 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -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;