Add scaleMode to SDL_SoftStretch(), remove SDL_SoftStretchLinear().

This commit is contained in:
Sylvain
2023-12-22 15:02:43 +01:00
committed by Sam Lantinga
parent 5dba04b29b
commit ffd82fb7c4
9 changed files with 39 additions and 48 deletions

View File

@@ -861,8 +861,10 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked
SDL_Surface *dst, const SDL_Rect *dstrect);
/**
* Perform a fast, low quality, stretch blit between two surfaces of the same
* format.
* Perform stretch blit between two surfaces of the same format.
*
* Using SDL_SCALEMODE_NEAREST: fast, low quality.
* Using SDL_SCALEMODE_LINEAR: bilinear scaling, slower, better quality, only 32BPP.
*
* \param src the SDL_Surface structure to be copied from
* \param srcrect the SDL_Rect structure representing the rectangle to be
@@ -870,6 +872,7 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked
* \param dst the SDL_Surface structure that is the blit target
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface
* \param scaleMode scale algorithm to be used
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
@@ -880,29 +883,8 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src,
const SDL_Rect *srcrect,
SDL_Surface *dst,
const SDL_Rect *dstrect);
/**
* Perform bilinear scaling between two surfaces of the same format, 32BPP.
*
* \param src the SDL_Surface structure to be copied from
* \param srcrect the SDL_Rect structure representing the rectangle to be
* copied
* \param dst the SDL_Surface structure that is the blit target
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_BlitSurfaceScaled
*/
extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface *src,
const SDL_Rect *srcrect,
SDL_Surface *dst,
const SDL_Rect *dstrect);
const SDL_Rect *dstrect,
SDL_ScaleMode scaleMode);
/**
* Perform a scaled surface copy to a destination surface.