ddraw: Move the TEXTUREMANAGE validation from CreateSurface() to ddraw_surface_create_texture().
This commit is contained in:
parent
4d9c3151c3
commit
f0f38d9b8d
|
@ -2901,21 +2901,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
}
|
||||
}
|
||||
|
||||
if (DDSD->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
|
||||
{
|
||||
if (!(DDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
||||
{
|
||||
WARN("DDSCAPS2_TEXTUREMANAGE used without DDSCAPS_TEXTURE, returning DDERR_INVALIDCAPS.\n");
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
if (DDSD->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
|
||||
{
|
||||
WARN("DDSCAPS2_TEXTUREMANAGE used width DDSCAPS_VIDEOMEMORY "
|
||||
"or DDSCAPS_SYSTEMMEMORY, returning DDERR_INVALIDCAPS.\n");
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
}
|
||||
|
||||
/* Modify some flags */
|
||||
copy_to_surfacedesc2(&desc2, DDSD);
|
||||
|
||||
|
|
|
@ -5608,6 +5608,21 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
|
|||
DDRAW_dump_surface_desc(desc);
|
||||
}
|
||||
|
||||
if (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
|
||||
{
|
||||
if (!(desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
||||
{
|
||||
WARN("DDSCAPS2_TEXTUREMANAGE used without DDSCAPS_TEXTURE, returning DDERR_INVALIDCAPS.\n");
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
if (desc->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
|
||||
{
|
||||
WARN("DDSCAPS2_TEXTUREMANAGE used width DDSCAPS_VIDEOMEMORY "
|
||||
"or DDSCAPS_SYSTEMMEMORY, returning DDERR_INVALIDCAPS.\n");
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(hr = wined3d_get_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode, NULL)))
|
||||
{
|
||||
ERR("Failed to get display mode, hr %#x.\n", hr);
|
||||
|
|
Loading…
Reference in New Issue