Don't strip the alpha channel when scaling surfaces if it will be needed
Fixes https://github.com/libsdl-org/SDL/issues/15297
This commit is contained in:
@@ -1314,7 +1314,8 @@ bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, S
|
|||||||
// Change source format if not appropriate for scaling
|
// Change source format if not appropriate for scaling
|
||||||
if (SDL_BYTESPERPIXEL(src->format) != 4 || src->format == SDL_PIXELFORMAT_ARGB2101010) {
|
if (SDL_BYTESPERPIXEL(src->format) != 4 || src->format == SDL_PIXELFORMAT_ARGB2101010) {
|
||||||
SDL_PixelFormat fmt;
|
SDL_PixelFormat fmt;
|
||||||
if (SDL_BYTESPERPIXEL(dst->format) == 4 && dst->format != SDL_PIXELFORMAT_ARGB2101010) {
|
if (SDL_BYTESPERPIXEL(dst->format) == 4 && dst->format != SDL_PIXELFORMAT_ARGB2101010 &&
|
||||||
|
(SDL_ISPIXELFORMAT_ALPHA(dst->format) || !is_complex_copy_flags)) {
|
||||||
fmt = dst->format;
|
fmt = dst->format;
|
||||||
} else {
|
} else {
|
||||||
fmt = SDL_PIXELFORMAT_ARGB8888;
|
fmt = SDL_PIXELFORMAT_ARGB8888;
|
||||||
|
|||||||
Reference in New Issue
Block a user