mirror of
https://github.com/reactos/wine.git
synced 2025-02-22 13:53:38 +00:00
ddraw: Move the cube map validation from CreateSurface() to ddraw_surface_create_texture().
This commit is contained in:
parent
f0f38d9b8d
commit
995ff1d3f8
@ -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);
|
||||
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user