From 97f0345f71679570d4eedb4ab750158d1a80001c Mon Sep 17 00:00:00 2001 From: Riccardo Bortolato Date: Mon, 21 Dec 2015 18:38:39 +0100 Subject: [PATCH] ddraw: Check if surface is a mipmap sublevel or a non-positive X top level surface through caps in ddraw_surface7_GetPriority(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Riccardo Bortolato Signed-off-by: Stefan Dösinger Signed-off-by: Alexandre Julliard --- dlls/ddraw/surface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index c303ed0f80d..8a91d4b8d18 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -2377,9 +2377,12 @@ static HRESULT WINAPI ddraw_surface7_GetPriority(IDirectDrawSurface7 *iface, DWO WARN("Called on offscreenplain surface, returning DDERR_INVALIDOBJECT.\n"); hr = DDERR_INVALIDOBJECT; } - else if (!(surface->surface_desc.ddsCaps.dwCaps2 & managed) || !surface->wined3d_texture) + else if (!(surface->surface_desc.ddsCaps.dwCaps2 & managed) + || (surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL) + || ((surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) + && !(surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_POSITIVEX))) { - WARN("Called on non-managed texture or mipmap sublevel, returning DDERR_INVALIDPARAMS.\n"); + WARN("Called on non-managed texture, mipmap sublevel or non +X toplevel surface, returning DDERR_INVALIDPARAMS.\n"); hr = DDERR_INVALIDPARAMS; } else -- 2.11.4.GIT