mirror of https://github.com/encounter/SDL.git
Fixed bug 3309 - SDL_ConvertSurface adds AlphaMod when input surface has ColorKey
Sylvain Let's you have a SDL_Surface that has ColorKey, but no Alpha Modulation. When this surface is duplicated with SDL_ConvertSurface function, the result has ColorKey and Alpha Modulation (BLEND, and Opaque 255). I think SDL_ConvertSurface should strictly keeps the input format. example ======= SDL_Surface *input; // ... Set up a surface with ColorKey and no AlphaMod SDL_Surface *output = SDL_ConvertSurface(input, input->format, input->flags); // "output" surface has a ColorKey but *also* AlphaMod (BLEND, and Opaque 255).
This commit is contained in:
parent
e4124ff56d
commit
1a5441451c
|
@ -986,7 +986,7 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format,
|
||||||
/* Enable alpha blending by default if the new surface has an
|
/* Enable alpha blending by default if the new surface has an
|
||||||
* alpha channel or alpha modulation */
|
* alpha channel or alpha modulation */
|
||||||
if ((surface->format->Amask && format->Amask) ||
|
if ((surface->format->Amask && format->Amask) ||
|
||||||
(copy_flags & (SDL_COPY_COLORKEY|SDL_COPY_MODULATE_ALPHA))) {
|
(copy_flags & SDL_COPY_MODULATE_ALPHA)) {
|
||||||
SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND);
|
SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND);
|
||||||
}
|
}
|
||||||
if ((copy_flags & SDL_COPY_RLE_DESIRED) || (flags & SDL_RLEACCEL)) {
|
if ((copy_flags & SDL_COPY_RLE_DESIRED) || (flags & SDL_RLEACCEL)) {
|
||||||
|
|
Loading…
Reference in New Issue