From 8a5444d40c8359a30c4c6a83ac53d2a2b3c8e9bc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 12 Feb 2024 11:27:01 -0800 Subject: [PATCH] Updated for recent SDL3 changes --- external/SDL | 2 +- include/SDL3_image/SDL_image.h | 3 +-- src/IMG.c | 10 +++++----- src/IMG_png.c | 4 ++-- src/IMG_pnm.c | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/external/SDL b/external/SDL index 7fbd85ad..814a94c3 160000 --- a/external/SDL +++ b/external/SDL @@ -1 +1 @@ -Subproject commit 7fbd85ad5cf30d46ef20628a212bbec3c1ffec2b +Subproject commit 814a94c34985c6d3a7fbd906885b1dfea0979925 diff --git a/include/SDL3_image/SDL_image.h b/include/SDL3_image/SDL_image.h index b8a8d2e3..14a07c65 100644 --- a/include/SDL3_image/SDL_image.h +++ b/include/SDL3_image/SDL_image.h @@ -30,7 +30,6 @@ #define SDL_IMAGE_H_ #include -#include #include /* Set up for C function definitions, even when using C++ */ @@ -86,7 +85,7 @@ extern "C" { * * \returns SDL_image version */ -extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void); +extern DECLSPEC const SDL_Version * SDLCALL IMG_Linked_Version(void); /** * Initialization flags diff --git a/src/IMG.c b/src/IMG.c index c378336f..90026bb1 100644 --- a/src/IMG.c +++ b/src/IMG.c @@ -39,11 +39,11 @@ SDL_COMPILE_TIME_ASSERT(SDL_BUILD_MICRO_VERSION, #if defined(SDL_COMPILE_TIME_ASSERT) SDL_COMPILE_TIME_ASSERT(SDL_IMAGE_MAJOR_VERSION_min, SDL_IMAGE_MAJOR_VERSION >= 0); -/* Limited only by the need to fit in SDL_version */ +/* Limited only by the need to fit in SDL_Version */ SDL_COMPILE_TIME_ASSERT(SDL_IMAGE_MAJOR_VERSION_max, SDL_IMAGE_MAJOR_VERSION <= 255); SDL_COMPILE_TIME_ASSERT(SDL_IMAGE_MINOR_VERSION_min, SDL_IMAGE_MINOR_VERSION >= 0); -/* Limited only by the need to fit in SDL_version */ +/* Limited only by the need to fit in SDL_Version */ SDL_COMPILE_TIME_ASSERT(SDL_IMAGE_MINOR_VERSION_max, SDL_IMAGE_MINOR_VERSION <= 255); SDL_COMPILE_TIME_ASSERT(SDL_IMAGE_PATCHLEVEL_min, SDL_IMAGE_PATCHLEVEL >= 0); @@ -90,10 +90,10 @@ static struct { { "WEBP", IMG_isWEBP, IMG_LoadWEBPAnimation_RW }, }; -const SDL_version *IMG_Linked_Version(void) +const SDL_Version *IMG_Linked_Version(void) { - static SDL_version linked_version; - SDL_IMAGE_VERSION(&linked_version); + static SDL_Version linked_version; + SDL_IMAGE_VERSION(&linked_version) return(&linked_version); } diff --git a/src/IMG_png.c b/src/IMG_png.c index 41620084..3bfbec5a 100644 --- a/src/IMG_png.c +++ b/src/IMG_png.c @@ -760,11 +760,11 @@ static int IMG_SavePNG_RW_miniz(SDL_Surface *surface, SDL_RWops *dst) } if (surface->format->format == png_format) { - png = tdefl_write_image_to_png_file_in_memory(surface->pixels, surface->w, surface->h, surface->format->BytesPerPixel, surface->pitch, &size); + png = tdefl_write_image_to_png_file_in_memory(surface->pixels, surface->w, surface->h, surface->format->bytes_per_pixel, surface->pitch, &size); } else { SDL_Surface *cvt = SDL_ConvertSurfaceFormat(surface, png_format); if (cvt) { - png = tdefl_write_image_to_png_file_in_memory(cvt->pixels, cvt->w, cvt->h, cvt->format->BytesPerPixel, cvt->pitch, &size); + png = tdefl_write_image_to_png_file_in_memory(cvt->pixels, cvt->w, cvt->h, cvt->format->bytes_per_pixel, cvt->pitch, &size); SDL_DestroySurface(cvt); } } diff --git a/src/IMG_pnm.c b/src/IMG_pnm.c index d8e6bb15..08dc7206 100644 --- a/src/IMG_pnm.c +++ b/src/IMG_pnm.c @@ -162,7 +162,7 @@ SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src) } if ( surface == NULL ) ERROR("Out of memory"); - bpl = width * surface->format->BytesPerPixel; + bpl = width * surface->format->bytes_per_pixel; if(kind == PGM) { SDL_Color *c = surface->format->palette->colors; int i;