Fixed scaling YUV surfaces
This commit is contained in:
@@ -2227,7 +2227,7 @@ SDL_Surface *SDL_ScaleSurface(SDL_Surface *surface, int width, int height, SDL_S
|
|||||||
|
|
||||||
if (SDL_ISPIXELFORMAT_FOURCC(surface->format)) {
|
if (SDL_ISPIXELFORMAT_FOURCC(surface->format)) {
|
||||||
// We can't directly scale a YUV surface (yet!)
|
// 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) {
|
if (!tmp) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -2237,10 +2237,9 @@ SDL_Surface *SDL_ScaleSurface(SDL_Surface *surface, int width, int height, SDL_S
|
|||||||
if (!scaled) {
|
if (!scaled) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
tmp = scaled;
|
|
||||||
|
|
||||||
SDL_Surface *result = SDL_ConvertSurfaceAndColorspace(tmp, surface->format, NULL, surface->colorspace, surface->props);
|
SDL_Surface *result = SDL_ConvertSurfaceAndColorspace(scaled, surface->format, NULL, surface->colorspace, surface->props);
|
||||||
SDL_DestroySurface(tmp);
|
SDL_DestroySurface(scaled);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user