From 5b4a3e26b3f560a60c30d7477134dff4f187107e Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 18 Sep 2024 10:51:42 -0700
Subject: [PATCH] Updated to the latest version of SDL
---
examples/showimage.c | 4 +-
external/SDL | 2 +-
include/SDL3_image/SDL_image.h | 114 ++++++++++-----------
src/IMG.c | 20 ++--
src/IMG_ImageIO.m | 22 ++--
src/IMG_WIC.c | 46 ++++-----
src/IMG_avif.c | 48 ++++-----
src/IMG_bmp.c | 50 ++++-----
src/IMG_gif.c | 30 +++---
src/IMG_jpg.c | 78 +++++++--------
src/IMG_jxl.c | 18 ++--
src/IMG_lbm.c | 16 +--
src/IMG_pcx.c | 14 +--
src/IMG_png.c | 60 +++++------
src/IMG_pnm.c | 14 +--
src/IMG_qoi.c | 16 +--
src/IMG_stb.c | 14 +--
src/IMG_svg.c | 16 +--
src/IMG_tga.c | 2 +-
src/IMG_tif.c | 14 +--
src/IMG_webp.c | 16 +--
src/IMG_xcf.c | 10 +-
src/IMG_xpm.c | 22 ++--
src/IMG_xv.c | 14 +--
src/IMG_xxx.c | 12 +--
test/main.c | 178 ++++++++++++++++-----------------
26 files changed, 425 insertions(+), 425 deletions(-)
diff --git a/examples/showimage.c b/examples/showimage.c
index caf339d5..504b419e 100644
--- a/examples/showimage.c
+++ b/examples/showimage.c
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
goto done;
}
- if (SDL_GetBooleanProperty(SDL_GetDisplayProperties(SDL_GetPrimaryDisplay()), SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN, SDL_FALSE)) {
+ if (SDL_GetBooleanProperty(SDL_GetDisplayProperties(SDL_GetPrimaryDisplay()), SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN, false)) {
SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
@@ -173,7 +173,7 @@ int main(int argc, char *argv[])
SDL_Surface *surface = IMG_Load(argv[i]);
if (surface) {
const char *ext = SDL_strrchr(saveFile, '.');
- SDL_bool saved = SDL_FALSE;
+ bool saved = false;
if (ext && SDL_strcasecmp(ext, ".avif") == 0) {
saved = IMG_SaveAVIF(surface, saveFile, 90);
} else if (ext && SDL_strcasecmp(ext, ".bmp") == 0) {
diff --git a/external/SDL b/external/SDL
index 03ae792d..23f855a9 160000
--- a/external/SDL
+++ b/external/SDL
@@ -1 +1 @@
-Subproject commit 03ae792df35a15e80e16a41ea2cf19971fc8d8f6
+Subproject commit 23f855a9703ba74d174d1c5ea90b1debc39b52a9
diff --git a/include/SDL3_image/SDL_image.h b/include/SDL3_image/SDL_image.h
index 359b305c..3aab6ec1 100644
--- a/include/SDL3_image/SDL_image.h
+++ b/include/SDL3_image/SDL_image.h
@@ -189,7 +189,7 @@ extern SDL_DECLSPEC void SDLCALL IMG_Quit(void);
* by calling: SDL_SetSurfaceColorKey(image, SDL_RLEACCEL,
* image->format->colorkey);
*
- * If `closeio` is SDL_TRUE, `src` will be closed before returning, whether
+ * If `closeio` is true, `src` will be closed before returning, whether
* this function succeeds or not. SDL_image reads everything it needs from
* `src` during this call in any case.
*
@@ -216,8 +216,8 @@ extern SDL_DECLSPEC void SDLCALL IMG_Quit(void);
* call to SDL_DestroySurface().
*
* \param src an SDL_IOStream that data will be read from.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \param type a filename extension that represent this data ("BMP", "GIF",
* "PNG", etc).
* \returns a new SDL surface, or NULL on error.
@@ -228,7 +228,7 @@ extern SDL_DECLSPEC void SDLCALL IMG_Quit(void);
* \sa IMG_Load_IO
* \sa SDL_DestroySurface
*/
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_IO(SDL_IOStream *src, SDL_bool closeio, const char *type);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_IO(SDL_IOStream *src, bool closeio, const char *type);
/**
* Load an image from a filesystem path into a software surface.
@@ -296,7 +296,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
* by calling: SDL_SetSurfaceColorKey(image, SDL_RLEACCEL,
* image->format->colorkey);
*
- * If `closeio` is SDL_TRUE, `src` will be closed before returning, whether
+ * If `closeio` is true, `src` will be closed before returning, whether
* this function succeeds or not. SDL_image reads everything it needs from
* `src` during this call in any case.
*
@@ -317,8 +317,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
* call to SDL_DestroySurface().
*
* \param src an SDL_IOStream that data will be read from.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \returns a new SDL surface, or NULL on error.
*
* \since This function is available since SDL_image 3.0.0.
@@ -327,7 +327,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
* \sa IMG_LoadTyped_IO
* \sa SDL_DestroySurface
*/
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load_IO(SDL_IOStream *src, SDL_bool closeio);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load_IO(SDL_IOStream *src, bool closeio);
#if SDL_VERSION_ATLEAST(2,0,0)
@@ -380,7 +380,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer
* data (but in many cases, this will just end up being 32-bit RGB or 32-bit
* RGBA).
*
- * If `closeio` is SDL_TRUE, `src` will be closed before returning, whether
+ * If `closeio` is true, `src` will be closed before returning, whether
* this function succeeds or not. SDL_image reads everything it needs from
* `src` during this call in any case.
*
@@ -401,8 +401,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer
*
* \param renderer the SDL_Renderer to use to create the GPU texture.
* \param src an SDL_IOStream that data will be read from.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \returns a new texture, or NULL on error.
*
* \since This function is available since SDL_image 3.0.0.
@@ -411,7 +411,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer
* \sa IMG_LoadTextureTyped_IO
* \sa SDL_DestroyTexture
*/
-extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_IO(SDL_Renderer *renderer, SDL_IOStream *src, SDL_bool closeio);
+extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_IO(SDL_Renderer *renderer, SDL_IOStream *src, bool closeio);
/**
* Load an image from an SDL data source into a GPU texture.
@@ -427,7 +427,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_IO(SDL_Renderer *rende
* data (but in many cases, this will just end up being 32-bit RGB or 32-bit
* RGBA).
*
- * If `closeio` is SDL_TRUE, `src` will be closed before returning, whether
+ * If `closeio` is true, `src` will be closed before returning, whether
* this function succeeds or not. SDL_image reads everything it needs from
* `src` during this call in any case.
*
@@ -454,8 +454,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_IO(SDL_Renderer *rende
*
* \param renderer the SDL_Renderer to use to create the GPU texture.
* \param src an SDL_IOStream that data will be read from.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \param type a filename extension that represent this data ("BMP", "GIF",
* "PNG", etc).
* \returns a new texture, or NULL on error.
@@ -466,7 +466,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_IO(SDL_Renderer *rende
* \sa IMG_LoadTexture_IO
* \sa SDL_DestroyTexture
*/
-extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_IO(SDL_Renderer *renderer, SDL_IOStream *src, SDL_bool closeio, const char *type);
+extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_IO(SDL_Renderer *renderer, SDL_IOStream *src, bool closeio, const char *type);
#endif /* SDL 2.0 */
/**
@@ -511,7 +511,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_IO(SDL_Renderer *
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isAVIF(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isAVIF(SDL_IOStream *src);
/**
* Detect ICO image data on a readable/seekable SDL_IOStream.
@@ -554,7 +554,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isAVIF(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isICO(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isICO(SDL_IOStream *src);
/**
* Detect CUR image data on a readable/seekable SDL_IOStream.
@@ -597,7 +597,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isICO(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isCUR(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isCUR(SDL_IOStream *src);
/**
* Detect BMP image data on a readable/seekable SDL_IOStream.
@@ -640,7 +640,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isCUR(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isBMP(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isBMP(SDL_IOStream *src);
/**
* Detect GIF image data on a readable/seekable SDL_IOStream.
@@ -683,7 +683,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isBMP(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isGIF(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isGIF(SDL_IOStream *src);
/**
* Detect JPG image data on a readable/seekable SDL_IOStream.
@@ -726,7 +726,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isGIF(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isJPG(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isJPG(SDL_IOStream *src);
/**
* Detect JXL image data on a readable/seekable SDL_IOStream.
@@ -769,7 +769,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isJPG(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isJXL(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isJXL(SDL_IOStream *src);
/**
* Detect LBM image data on a readable/seekable SDL_IOStream.
@@ -812,7 +812,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isJXL(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isLBM(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isLBM(SDL_IOStream *src);
/**
* Detect PCX image data on a readable/seekable SDL_IOStream.
@@ -855,7 +855,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isLBM(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isPCX(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isPCX(SDL_IOStream *src);
/**
* Detect PNG image data on a readable/seekable SDL_IOStream.
@@ -898,7 +898,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isPCX(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isPNG(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isPNG(SDL_IOStream *src);
/**
* Detect PNM image data on a readable/seekable SDL_IOStream.
@@ -941,7 +941,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isPNG(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isPNM(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isPNM(SDL_IOStream *src);
/**
* Detect SVG image data on a readable/seekable SDL_IOStream.
@@ -984,7 +984,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isPNM(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isSVG(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isSVG(SDL_IOStream *src);
/**
* Detect QOI image data on a readable/seekable SDL_IOStream.
@@ -1027,7 +1027,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isSVG(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isQOI(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isQOI(SDL_IOStream *src);
/**
* Detect TIFF image data on a readable/seekable SDL_IOStream.
@@ -1070,7 +1070,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isQOI(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isTIF(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isTIF(SDL_IOStream *src);
/**
* Detect XCF image data on a readable/seekable SDL_IOStream.
@@ -1113,7 +1113,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isTIF(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isXCF(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isXCF(SDL_IOStream *src);
/**
* Detect XPM image data on a readable/seekable SDL_IOStream.
@@ -1156,7 +1156,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isXCF(SDL_IOStream *src);
* \sa IMG_isXV
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isXPM(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isXPM(SDL_IOStream *src);
/**
* Detect XV image data on a readable/seekable SDL_IOStream.
@@ -1199,7 +1199,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isXPM(SDL_IOStream *src);
* \sa IMG_isXPM
* \sa IMG_isWEBP
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isXV(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isXV(SDL_IOStream *src);
/**
* Detect WEBP image data on a readable/seekable SDL_IOStream.
@@ -1242,7 +1242,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isXV(SDL_IOStream *src);
* \sa IMG_isXPM
* \sa IMG_isXV
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_isWEBP(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isWEBP(SDL_IOStream *src);
/**
* Load a AVIF image directly.
@@ -1964,20 +1964,20 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArrayToRGB888(char **xp
*
* \sa IMG_SaveAVIF_IO
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveAVIF(SDL_Surface *surface, const char *file, int quality);
+extern SDL_DECLSPEC bool SDLCALL IMG_SaveAVIF(SDL_Surface *surface, const char *file, int quality);
/**
* Save an SDL_Surface into AVIF image data, via an SDL_IOStream.
*
* If you just want to save to a filename, you can use IMG_SaveAVIF() instead.
*
- * If `closeio` is SDL_TRUE, `dst` will be closed before returning, whether
+ * If `closeio` is true, `dst` will be closed before returning, whether
* this function succeeds or not.
*
* \param surface the SDL surface to save.
* \param dst the SDL_IOStream to save the image data to.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \param quality the desired quality, ranging between 0 (lowest) and 100
* (highest).
* \returns 0 if successful, -1 on error.
@@ -1986,7 +1986,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveAVIF(SDL_Surface *surface, const ch
*
* \sa IMG_SaveAVIF
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveAVIF_IO(SDL_Surface *surface, SDL_IOStream *dst, int closeio, int quality);
+extern SDL_DECLSPEC bool SDLCALL IMG_SaveAVIF_IO(SDL_Surface *surface, SDL_IOStream *dst, int closeio, int quality);
/**
* Save an SDL_Surface into a PNG image file.
@@ -2001,27 +2001,27 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveAVIF_IO(SDL_Surface *surface, SDL_I
*
* \sa IMG_SavePNG_IO
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SavePNG(SDL_Surface *surface, const char *file);
+extern SDL_DECLSPEC bool SDLCALL IMG_SavePNG(SDL_Surface *surface, const char *file);
/**
* Save an SDL_Surface into PNG image data, via an SDL_IOStream.
*
* If you just want to save to a filename, you can use IMG_SavePNG() instead.
*
- * If `closeio` is SDL_TRUE, `dst` will be closed before returning, whether
+ * If `closeio` is true, `dst` will be closed before returning, whether
* this function succeeds or not.
*
* \param surface the SDL surface to save.
* \param dst the SDL_IOStream to save the image data to.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \returns 0 if successful, -1 on error.
*
* \since This function is available since SDL_image 3.0.0.
*
* \sa IMG_SavePNG
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SavePNG_IO(SDL_Surface *surface, SDL_IOStream *dst, int closeio);
+extern SDL_DECLSPEC bool SDLCALL IMG_SavePNG_IO(SDL_Surface *surface, SDL_IOStream *dst, int closeio);
/**
* Save an SDL_Surface into a JPEG image file.
@@ -2038,20 +2038,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SavePNG_IO(SDL_Surface *surface, SDL_IO
*
* \sa IMG_SaveJPG_IO
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveJPG(SDL_Surface *surface, const char *file, int quality);
+extern SDL_DECLSPEC bool SDLCALL IMG_SaveJPG(SDL_Surface *surface, const char *file, int quality);
/**
* Save an SDL_Surface into JPEG image data, via an SDL_IOStream.
*
* If you just want to save to a filename, you can use IMG_SaveJPG() instead.
*
- * If `closeio` is SDL_TRUE, `dst` will be closed before returning, whether
+ * If `closeio` is true, `dst` will be closed before returning, whether
* this function succeeds or not.
*
* \param surface the SDL surface to save.
* \param dst the SDL_IOStream to save the image data to.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \param quality [0; 33] is Lowest quality, [34; 66] is Middle quality, [67;
* 100] is Highest quality.
* \returns 0 if successful, -1 on error.
@@ -2060,7 +2060,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveJPG(SDL_Surface *surface, const cha
*
* \sa IMG_SaveJPG
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL IMG_SaveJPG_IO(SDL_Surface *surface, SDL_IOStream *dst, int closeio, int quality);
+extern SDL_DECLSPEC bool SDLCALL IMG_SaveJPG_IO(SDL_Surface *surface, SDL_IOStream *dst, int closeio, int quality);
/**
* Animated image support Currently only animated GIFs are supported.
@@ -2091,7 +2091,7 @@ extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation(const char *file);
/**
* Load an animation from an SDL_IOStream.
*
- * If `closeio` is SDL_TRUE, `src` will be closed before returning, whether
+ * If `closeio` is true, `src` will be closed before returning, whether
* this function succeeds or not. SDL_image reads everything it needs from
* `src` during this call in any case.
*
@@ -2099,15 +2099,15 @@ extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation(const char *file);
* call to IMG_FreeAnimation().
*
* \param src an SDL_IOStream that data will be read from.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \returns a new IMG_Animation, or NULL on error.
*
* \since This function is available since SDL_image 3.0.0.
*
* \sa IMG_FreeAnimation
*/
-extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation_IO(SDL_IOStream *src, SDL_bool closeio);
+extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation_IO(SDL_IOStream *src, bool closeio);
/**
* Load an animation from an SDL datasource
@@ -2118,7 +2118,7 @@ extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation_IO(SDL_IOStream *s
* that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
* its ability to guess the format.
*
- * If `closeio` is SDL_TRUE, `src` will be closed before returning, whether
+ * If `closeio` is true, `src` will be closed before returning, whether
* this function succeeds or not. SDL_image reads everything it needs from
* `src` during this call in any case.
*
@@ -2126,8 +2126,8 @@ extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation_IO(SDL_IOStream *s
* call to IMG_FreeAnimation().
*
* \param src an SDL_IOStream that data will be read from.
- * \param closeio SDL_TRUE to close/free the SDL_IOStream before returning,
- * SDL_FALSE to leave it open.
+ * \param closeio true to close/free the SDL_IOStream before returning,
+ * false to leave it open.
* \param type a filename extension that represent this data ("GIF", etc).
* \returns a new IMG_Animation, or NULL on error.
*
@@ -2137,7 +2137,7 @@ extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation_IO(SDL_IOStream *s
* \sa IMG_LoadAnimation_IO
* \sa IMG_FreeAnimation
*/
-extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimationTyped_IO(SDL_IOStream *src, SDL_bool closeio, const char *type);
+extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimationTyped_IO(SDL_IOStream *src, bool closeio, const char *type);
/**
* Dispose of an IMG_Animation and free its resources.
diff --git a/src/IMG.c b/src/IMG.c
index b7451559..28bd83b1 100644
--- a/src/IMG.c
+++ b/src/IMG.c
@@ -48,7 +48,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_IMAGE_MICRO_VERSION_max, SDL_IMAGE_MICRO_VERSION <=
/* Table of image detection and loading functions */
static struct {
const char *type;
- SDL_bool (SDLCALL *is)(SDL_IOStream *src);
+ bool (SDLCALL *is)(SDL_IOStream *src);
SDL_Surface *(SDLCALL *load)(SDL_IOStream *src);
} supported[] = {
/* keep magicless formats first */
@@ -76,7 +76,7 @@ static struct {
/* Table of animation detection and loading functions */
static struct {
const char *type;
- SDL_bool (SDLCALL *is)(SDL_IOStream *src);
+ bool (SDLCALL *is)(SDL_IOStream *src);
IMG_Animation *(SDLCALL *load)(SDL_IOStream *src);
} supported_anims[] = {
/* keep magicless formats first */
@@ -182,18 +182,18 @@ SDL_Surface *IMG_Load(const char *file)
/* The error message has been set in SDL_IOFromFile */
return NULL;
}
- return IMG_LoadTyped_IO(src, SDL_TRUE, ext);
+ return IMG_LoadTyped_IO(src, true, ext);
}
#endif
/* Load an image from an SDL datasource (for compatibility) */
-SDL_Surface *IMG_Load_IO(SDL_IOStream *src, SDL_bool closeio)
+SDL_Surface *IMG_Load_IO(SDL_IOStream *src, bool closeio)
{
return IMG_LoadTyped_IO(src, closeio, NULL);
}
/* Load an image from an SDL datasource, optionally specifying the type */
-SDL_Surface *IMG_LoadTyped_IO(SDL_IOStream *src, SDL_bool closeio, const char *type)
+SDL_Surface *IMG_LoadTyped_IO(SDL_IOStream *src, bool closeio, const char *type)
{
size_t i;
SDL_Surface *image;
@@ -276,7 +276,7 @@ SDL_Texture *IMG_LoadTexture(SDL_Renderer *renderer, const char *file)
return texture;
}
-SDL_Texture *IMG_LoadTexture_IO(SDL_Renderer *renderer, SDL_IOStream *src, SDL_bool closeio)
+SDL_Texture *IMG_LoadTexture_IO(SDL_Renderer *renderer, SDL_IOStream *src, bool closeio)
{
SDL_Texture *texture = NULL;
SDL_Surface *surface = IMG_Load_IO(src, closeio);
@@ -287,7 +287,7 @@ SDL_Texture *IMG_LoadTexture_IO(SDL_Renderer *renderer, SDL_IOStream *src, SDL_b
return texture;
}
-SDL_Texture *IMG_LoadTextureTyped_IO(SDL_Renderer *renderer, SDL_IOStream *src, SDL_bool closeio, const char *type)
+SDL_Texture *IMG_LoadTextureTyped_IO(SDL_Renderer *renderer, SDL_IOStream *src, bool closeio, const char *type)
{
SDL_Texture *texture = NULL;
SDL_Surface *surface = IMG_LoadTyped_IO(src, closeio, type);
@@ -311,17 +311,17 @@ IMG_Animation *IMG_LoadAnimation(const char *file)
/* The error message has been set in SDL_IOFromFile */
return NULL;
}
- return IMG_LoadAnimationTyped_IO(src, SDL_TRUE, ext);
+ return IMG_LoadAnimationTyped_IO(src, true, ext);
}
/* Load an animation from an SDL datasource (for compatibility) */
-IMG_Animation *IMG_LoadAnimation_IO(SDL_IOStream *src, SDL_bool closeio)
+IMG_Animation *IMG_LoadAnimation_IO(SDL_IOStream *src, bool closeio)
{
return IMG_LoadAnimationTyped_IO(src, closeio, NULL);
}
/* Load an animation from an SDL datasource, optionally specifying the type */
-IMG_Animation *IMG_LoadAnimationTyped_IO(SDL_IOStream *src, SDL_bool closeio, const char *type)
+IMG_Animation *IMG_LoadAnimationTyped_IO(SDL_IOStream *src, bool closeio, const char *type)
{
size_t i;
IMG_Animation *anim;
diff --git a/src/IMG_ImageIO.m b/src/IMG_ImageIO.m
index 8c4bd0bc..2d6eef01 100644
--- a/src/IMG_ImageIO.m
+++ b/src/IMG_ImageIO.m
@@ -391,12 +391,12 @@ void IMG_QuitTIF(void)
{
}
-static SDL_bool Internal_isType (SDL_IOStream *rw_ops, CFStringRef uti_string_to_test)
+static bool Internal_isType (SDL_IOStream *rw_ops, CFStringRef uti_string_to_test)
{
- SDL_bool is_type = SDL_FALSE;
+ bool is_type = false;
if (rw_ops == NULL) {
- return SDL_FALSE;
+ return false;
}
Sint64 start = SDL_TellIO(rw_ops);
@@ -433,25 +433,25 @@ static SDL_bool Internal_isType (SDL_IOStream *rw_ops, CFStringRef uti_string_to
#ifdef BMP_USES_IMAGEIO
-SDL_bool IMG_isCUR(SDL_IOStream *src)
+bool IMG_isCUR(SDL_IOStream *src)
{
/* FIXME: Is this a supported type? */
return Internal_isType(src, CFSTR("com.microsoft.cur"));
}
-SDL_bool IMG_isICO(SDL_IOStream *src)
+bool IMG_isICO(SDL_IOStream *src)
{
return Internal_isType(src, kUTTypeICO);
}
-SDL_bool IMG_isBMP(SDL_IOStream *src)
+bool IMG_isBMP(SDL_IOStream *src)
{
return Internal_isType(src, kUTTypeBMP);
}
#endif /* BMP_USES_IMAGEIO */
-SDL_bool IMG_isGIF(SDL_IOStream *src)
+bool IMG_isGIF(SDL_IOStream *src)
{
return Internal_isType(src, kUTTypeGIF);
}
@@ -459,7 +459,7 @@ SDL_bool IMG_isGIF(SDL_IOStream *src)
#ifdef JPG_USES_IMAGEIO
// Note: JPEG 2000 is kUTTypeJPEG2000
-SDL_bool IMG_isJPG(SDL_IOStream *src)
+bool IMG_isJPG(SDL_IOStream *src)
{
return Internal_isType(src, kUTTypeJPEG);
}
@@ -468,7 +468,7 @@ SDL_bool IMG_isJPG(SDL_IOStream *src)
#ifdef PNG_USES_IMAGEIO
-SDL_bool IMG_isPNG(SDL_IOStream *src)
+bool IMG_isPNG(SDL_IOStream *src)
{
return Internal_isType(src, kUTTypePNG);
}
@@ -476,12 +476,12 @@ SDL_bool IMG_isPNG(SDL_IOStream *src)
#endif /* PNG_USES_IMAGEIO */
// This isn't a public API function. Apple seems to be able to identify tga's.
-SDL_bool IMG_isTGA(SDL_IOStream *src)
+bool IMG_isTGA(SDL_IOStream *src)
{
return Internal_isType(src, CFSTR("com.truevision.tga-image"));
}
-SDL_bool IMG_isTIF(SDL_IOStream *src)
+bool IMG_isTIF(SDL_IOStream *src)
{
return Internal_isType(src, kUTTypeTIFF);
}
diff --git a/src/IMG_WIC.c b/src/IMG_WIC.c
index d00fddcd..a4762144 100644
--- a/src/IMG_WIC.c
+++ b/src/IMG_WIC.c
@@ -84,35 +84,35 @@ void IMG_QuitTIF(void)
WIC_Quit();
}
-SDL_bool IMG_isPNG(SDL_IOStream *src)
+bool IMG_isPNG(SDL_IOStream *src)
{
Sint64 start;
- SDL_bool is_PNG;
+ bool is_PNG;
Uint8 magic[4];
if (!src) {
- return SDL_FALSE;
+ return false;
}
start = SDL_TellIO(src);
- is_PNG = SDL_FALSE;
+ is_PNG = false;
if (SDL_ReadIO(src, magic, sizeof(magic)) == sizeof(magic) ) {
if ( magic[0] == 0x89 &&
magic[1] == 'P' &&
magic[2] == 'N' &&
magic[3] == 'G' ) {
- is_PNG = SDL_TRUE;
+ is_PNG = true;
}
}
SDL_SeekIO(src, start, SDL_IO_SEEK_SET);
return is_PNG;
}
-SDL_bool IMG_isJPG(SDL_IOStream *src)
+bool IMG_isJPG(SDL_IOStream *src)
{
Sint64 start;
- SDL_bool is_JPG;
- SDL_bool in_scan;
+ bool is_JPG;
+ bool in_scan;
Uint8 magic[4];
/* This detection code is by Steaphan Greene <stea@cs.binghamton.edu> */
@@ -120,20 +120,20 @@ SDL_bool IMG_isJPG(SDL_IOStream *src)
/* And don't forget to report the problem to the the sdl list too! */
if (!src) {
- return SDL_FALSE;
+ return false;
}
start = SDL_TellIO(src);
- is_JPG = SDL_FALSE;
- in_scan = SDL_FALSE;
+ is_JPG = false;
+ in_scan = false;
if (SDL_ReadIO(src, magic, 2) == 2) {
if ( (magic[0] == 0xFF) && (magic[1] == 0xD8) ) {
- is_JPG = SDL_TRUE;
+ is_JPG = true;
while (is_JPG) {
if (SDL_ReadIO(src, magic, 2) != 2) {
- is_JPG = SDL_FALSE;
+ is_JPG = false;
} else if ( (magic[0] != 0xFF) && !in_scan ) {
- is_JPG = SDL_FALSE;
+ is_JPG = false;
} else if ( (magic[0] != 0xFF) || (magic[1] == 0xFF) ) {
/* Extra padding in JPEG (legal) */
/* or this is data and we are scanning */
@@ -146,7 +146,7 @@ SDL_bool IMG_isJPG(SDL_IOStream *src)
} else if ( (magic[1] >= 0xD0) && (magic[1] < 0xD9) ) {
/* These have nothing else */
} else if (SDL_ReadIO(src, magic+2, 2) != 2) {
- is_JPG = SDL_FALSE;
+ is_JPG = false;
} else {
/* Yes, it's big-endian */
Sint64 innerStart;
@@ -156,7 +156,7 @@ SDL_bool IMG_isJPG(SDL_IOStream *src)
size = (magic[2] << 8) + magic[3];
end = SDL_SeekIO(src, size-2, SDL_IO_SEEK_CUR);
if ( end != innerStart + size - 2 ) {
- is_JPG = SDL_FALSE;
+ is_JPG = false;
}
if ( magic[1] == 0xDA ) {
/* Now comes the actual JPEG meat */
@@ -165,7 +165,7 @@ SDL_bool IMG_isJPG(SDL_IOStream *src)
break;
#else
/* I'm not convinced. Prove it! */
- in_scan = SDL_TRUE;
+ in_scan = true;
#endif
}
}
@@ -176,18 +176,18 @@ SDL_bool IMG_isJPG(SDL_IOStream *src)
return is_JPG;
}
-SDL_bool IMG_isTIF(SDL_IOStream * src)
+bool IMG_isTIF(SDL_IOStream * src)
{
Sint64 start;
- SDL_bool is_TIF;
+ bool is_TIF;
Uint8 magic[4];
if (!src) {
- return SDL_FALSE;
+ return false;
}
start = SDL_TellIO(src);
- is_TIF = SDL_FALSE;
+ is_TIF = false;
if (SDL_ReadIO(src, magic, sizeof(magic)) == sizeof(magic) ) {
if ( (magic[0] == 'I' &&
magic[1] == 'I' &&
@@ -197,7 +197,7 @@ SDL_b
(Patch may be truncated, please check the link at the top of this post.)