diff --git a/SourceX/display.cpp b/SourceX/display.cpp index 6f46cd304..316f5c49c 100644 --- a/SourceX/display.cpp +++ b/SourceX/display.cpp @@ -304,23 +304,10 @@ SDL_Surface *CreateScaledSurface(SDL_Surface *src) SDLSurfaceUniquePtr ScaleSurfaceToOutput(SDLSurfaceUniquePtr surface) { #ifdef USE_SDL1 - SDL_Surface *ptr = surface.release(); - ScaleSurfaceToOutput(&ptr); - return SDLSurfaceUniquePtr{ptr}; -#else - return surface; -#endif -} - -void ScaleSurfaceToOutput(SDL_Surface **surface) -{ -#ifdef USE_SDL1 - if (!OutputRequiresScaling()) - return; - SDL_Surface *stretched = CreateScaledSurface(*surface); - SDL_FreeSurface((*surface)); - *surface = stretched; + if (OutputRequiresScaling()) + return SDLSurfaceUniquePtr { CreateScaledSurface(surface.get()) }; #endif + return surface; } } // namespace devilution diff --git a/SourceX/display.h b/SourceX/display.h index b5094eb80..ec5d716a0 100644 --- a/SourceX/display.h +++ b/SourceX/display.h @@ -42,10 +42,6 @@ void ScaleOutputRect(SDL_Rect *rect); // If the output requires software scaling, replaces the given surface with a scaled one. SDLSurfaceUniquePtr ScaleSurfaceToOutput(SDLSurfaceUniquePtr surface); -// Prefer the SDLSurfaceUniquePtr version. -// FIXME: Delete this version. -void ScaleSurfaceToOutput(SDL_Surface **surface); - // Convert from output coordinates to logical (resolution-independent) coordinates. template < typename T,