Module: wine Branch: master Commit: 995ff1d3f896b47caf6378456427a9605c3c34b7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=995ff1d3f896b47caf63784564...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Nov 26 10:41:51 2013 +0100
ddraw: Move the cube map validation from CreateSurface() to ddraw_surface_create_texture().
---
dlls/ddraw/ddraw.c | 24 ------------------------ dlls/ddraw/surface.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index a056ec6..c0b1304 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2877,30 +2877,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD, return DDERR_INVALIDCAPS; }
- /* Check cube maps but only if the size includes them */ - if (DDSD->dwSize >= sizeof(DDSURFACEDESC2)) - { - if(DDSD->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES && - !(DDSD->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)) - { - WARN("Cube map faces requested without cube map flag\n"); - return DDERR_INVALIDCAPS; - } - if(DDSD->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP && - (DDSD->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) == 0) - { - WARN("Cube map without faces requested\n"); - return DDERR_INVALIDPARAMS; - } - - /* Quick tests confirm those can be created, but we don't do that yet */ - if(DDSD->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP && - (DDSD->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) != DDSCAPS2_CUBEMAP_ALLFACES) - { - FIXME("Partial cube maps not supported yet\n"); - } - } - /* Modify some flags */ copy_to_surfacedesc2(&desc2, DDSD);
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index e34531f..c5ff3e6 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5608,6 +5608,24 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc, DDRAW_dump_surface_desc(desc); }
+ if ((desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) + && !(desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)) + { + WARN("Cube map faces requested without cube map flag.\n"); + return DDERR_INVALIDCAPS; + } + + if ((desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) + && !(desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES)) + { + WARN("Cube map without faces requested.\n"); + return DDERR_INVALIDPARAMS; + } + + if ((desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) + && (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) != DDSCAPS2_CUBEMAP_ALLFACES) + FIXME("Partial cube maps not implemented.\n"); + if (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE)) { if (!(desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE))