Commit 36207555 authored by Sam Lantinga's avatar Sam Lantinga

Set blend mode for textures that were created from surfaces with a colorkey

parent ce6f23bc
......@@ -1988,8 +1988,13 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
SDL_GetSurfaceAlphaMod(surface, &a);
SDL_SetTextureAlphaMod(texture, a);
SDL_GetSurfaceBlendMode(surface, &blendMode);
SDL_SetTextureBlendMode(texture, blendMode);
if (surface->map->info.flags & SDL_COPY_COLORKEY) {
/* We converted to a texture with alpha format */
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
} else {
SDL_GetSurfaceBlendMode(surface, &blendMode);
SDL_SetTextureBlendMode(texture, blendMode);
}
SDL_GetSurfaceScaleMode(surface, &scaleMode);
SDL_SetTextureScaleMode(texture, scaleMode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment