mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-03 07:36:04 +02:00
Don't strip the alpha channel when scaling surfaces if it will be needed
Fixes https://github.com/libsdl-org/SDL/issues/15297
(cherry picked from commit 501ee05129)
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
|
||||
if (SDL_BYTESPERPIXEL(src->format) != 4 || src->format == SDL_PIXELFORMAT_ARGB2101010) {
|
||||
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;
|
||||
} else {
|
||||
fmt = SDL_PIXELFORMAT_ARGB8888;
|
||||
|
||||
Reference in New Issue
Block a user