sdl2-compat: Add SDL_{Lower,Upper}BlitScaled()

From 152eec9dae094721f9c5204f70a76cbdb8e1f908 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Fri, 22 Dec 2023 10:40:15 +0100
Subject: [PATCH] Add SDL_{Lower,Upper}BlitScaled()

---
 src/sdl2_compat.c          |  8 +++++++-
 src/sdl3_include_wrapper.h | 10 ----------
 src/sdl3_syms.h            |  4 ++--
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index a4ea819..74408fa 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -2535,7 +2535,13 @@ SDL_LowerBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *d
 DECLSPEC int SDLCALL
 SDL_LowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
 {
-    return SDL3_BlitSurfaceUncheckedScaled(src, srcrect, dst, dstrect);
+    return SDL3_BlitSurfaceUncheckedScaled(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST);
+}
+
+DECLSPEC int SDLCALL
+SDL_UpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
+{
+    return SDL3_BlitSurfaceScaled(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST);
 }
 
 /* SDL_GetTicks is 64-bit in SDL3. Clamp it for SDL2. */
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index 3b20e96..6c9f8fc 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -988,8 +988,6 @@
 #define SDL_strnstr IGNORE_THIS_VERSION_OF_SDL_strnstr
 #define SDL_wcsnstr IGNORE_THIS_VERSION_OF_SDL_wcsnstr
 #define SDL_SyncWindow IGNORE_THIS_VERSION_OF_SDL_SyncWindow
-#define SDL_SetSurfaceScaleMode IGNORE_THIS_VERSION_OF_SDL_SetSurfaceScaleMode
-#define SDL_GetSurfaceScaleMode IGNORE_THIS_VERSION_OF_SDL_GetSurfaceScaleMode
 
 
 #define SDL_FUNCTION_POINTER_IS_VOID_POINTER 1
@@ -4858,14 +4856,6 @@
 #undef SDL_SyncWindow
 #endif
 
-#ifdef SDL_SetSurfaceScaleMode
-#undef SDL_SetSurfaceScaleMode
-#endif
-
-#ifdef SDL_GetSurfaceScaleMode
-#undef SDL_GetSurfaceScaleMode
-#endif
-
 /* undefine these macros, too: redefine as SDL3_xxx, if needed. */
 
 #ifdef SDL_enabled_assert
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 943f6f5..69f17bf 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -447,8 +447,8 @@ SDL3_SYM_RENAMED(int,FillRects,FillSurfaceRects,(SDL_Surface *a, const SDL_Rect
 SDL3_SYM_RENAMED(int,UpperBlit,BlitSurface,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
 SDL3_SYM(int,BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
 SDL3_SYM_PASSTHROUGH(int,SoftStretch,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
-SDL3_SYM_RENAMED(int,UpperBlitScaled,BlitSurfaceScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
-SDL3_SYM(int,BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
+SDL3_SYM(int,BlitSurfaceScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return)
+SDL3_SYM(int,BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return)
 SDL3_SYM_PASSTHROUGH(const char*,GetThreadName,(SDL_Thread *a),(a),return)
 SDL3_SYM_PASSTHROUGH(SDL_threadID,ThreadID,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_threadID,GetThreadID,(SDL_Thread *a),(a),return)