SDL_image: Fix build errors due to SDL3 changes

From 0031949d6673da3380ae36997cd3389fc854ca8e Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 5 Jan 2023 17:04:12 +0100
Subject: [PATCH] Fix build errors due to SDL3 changes

---
 IMG_tga.c | 10 +++++-----
 IMG_tif.c |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/IMG_tga.c b/IMG_tga.c
index 3db5cff8..7e0b4a7d 100644
--- a/IMG_tga.c
+++ b/IMG_tga.c
@@ -174,7 +174,7 @@ SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
         goto unsupported;
     }
 
-    SDL_RWseek(src, hdr.infolen, RW_SEEK_CUR); /* skip info field */
+    SDL_RWseek(src, hdr.infolen, SDL_RW_SEEK_CUR); /* skip info field */
 
     w = LE16(hdr.width);
     h = LE16(hdr.height);
@@ -218,10 +218,10 @@ SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
             }
             SDL_free(pal);
             if (ckey >= 0)
-                SDL_SetColorKey(img, SDL_TRUE, ckey);
+                SDL_SetSurfaceColorKey(img, SDL_TRUE, ckey);
         } else {
             /* skip unneeded colormap */
-            SDL_RWseek(src, palsiz, RW_SEEK_CUR);
+            SDL_RWseek(src, palsiz, SDL_RW_SEEK_CUR);
         }
     }
 
@@ -311,9 +311,9 @@ SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
     error = "Unsupported TGA format";
 
 error:
-    SDL_RWseek(src, start, RW_SEEK_SET);
+    SDL_RWseek(src, start, SDL_RW_SEEK_SET);
     if ( img ) {
-        SDL_FreeSurface(img);
+        SDL_DestroySurface(img);
     }
     IMG_SetError("%s", error);
     return NULL;
diff --git a/IMG_tif.c b/IMG_tif.c
index 7f11d3cb..dace9fbb 100644
--- a/IMG_tif.c
+++ b/IMG_tif.c
@@ -101,7 +101,7 @@ static toff_t tiff_seek(thandle_t fd, toff_t offset, int origin)
 
 static tsize_t tiff_write(thandle_t fd, tdata_t buf, tsize_t size)
 {
-    return (tsize_t)SDL_RWwrite((SDL_RWops*)fd, buf, 1, size);
+    return (tsize_t)SDL_RWwrite((SDL_RWops*)fd, buf, size);
 }
 
 static int tiff_close(thandle_t fd)