mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
Fixed scaling YUV surfaces
This commit is contained in:
parent
7553d5892e
commit
7d628ef76c
1 changed files with 3 additions and 4 deletions
|
|
@ -2227,7 +2227,7 @@ SDL_Surface *SDL_ScaleSurface(SDL_Surface *surface, int width, int height, SDL_S
|
|||
|
||||
if (SDL_ISPIXELFORMAT_FOURCC(surface->format)) {
|
||||
// We can't directly scale a YUV surface (yet!)
|
||||
SDL_Surface *tmp = SDL_CreateSurface(surface->w, surface->h, SDL_PIXELFORMAT_ARGB8888);
|
||||
SDL_Surface *tmp = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ARGB8888);
|
||||
if (!tmp) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -2237,10 +2237,9 @@ SDL_Surface *SDL_ScaleSurface(SDL_Surface *surface, int width, int height, SDL_S
|
|||
if (!scaled) {
|
||||
return NULL;
|
||||
}
|
||||
tmp = scaled;
|
||||
|
||||
SDL_Surface *result = SDL_ConvertSurfaceAndColorspace(tmp, surface->format, NULL, surface->colorspace, surface->props);
|
||||
SDL_DestroySurface(tmp);
|
||||
SDL_Surface *result = SDL_ConvertSurfaceAndColorspace(scaled, surface->format, NULL, surface->colorspace, surface->props);
|
||||
SDL_DestroySurface(scaled);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue