wined3d: Control SFLAG_CONVERTED in surface_prepare_texture.

This makes sure that the flag is set correctly when
surface_allocate_surface is called and client storage is disabled
properly for converted surfaces.
This commit is contained in:
Stefan Dösinger 2010-02-15 12:30:37 +01:00 committed by Alexandre Julliard
parent a19abd9fd5
commit 5c4d3fb5a2
1 changed files with 3 additions and 4 deletions

View File

@ -1265,6 +1265,9 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface, BOOL srgb)
if (surface->Flags & alloc_flag) return;
d3dfmt_get_conv(surface, TRUE, TRUE, &format, &internal, &type, &convert, &bpp, srgb);
if(convert != NO_CONVERSION) surface->Flags |= SFLAG_CONVERTED;
else surface->Flags &= ~SFLAG_CONVERTED;
if ((surface->Flags & SFLAG_NONPOW2) && !(surface->Flags & SFLAG_OVERSIZE))
{
width = surface->pow2Width;
@ -5060,17 +5063,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
return WINED3DERR_OUTOFVIDEOMEMORY;
}
d3dfmt_convert_surface(This->resource.allocatedMemory, mem, pitch, width, height, outpitch, convert, This);
This->Flags |= SFLAG_CONVERTED;
}
else if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
&& (gl_info->supported[EXT_PALETTED_TEXTURE] || gl_info->supported[ARB_FRAGMENT_PROGRAM]))
{
d3dfmt_p8_upload_palette(iface, convert);
This->Flags &= ~SFLAG_CONVERTED;
mem = This->resource.allocatedMemory;
} else {
This->Flags &= ~SFLAG_CONVERTED;
mem = This->resource.allocatedMemory;
}