wined3d: Control SFLAG_CONVERTED in surface_prepare_texture.
authorStefan Dösinger <stefan@codeweavers.com>
Mon, 15 Feb 2010 11:30:37 +0000 (12:30 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 17 Feb 2010 15:50:38 +0000 (16:50 +0100)
This makes sure that the flag is set correctly when
surface_allocate_surface is called and client storage is disabled
properly for converted surfaces.

dlls/wined3d/surface.c

index 1a37fb1e6a0c974a68d6613a3b11c51c93379697..d5d2246bc4e299bd679f074ff7933df291e9961b 100644 (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;
             }