Skip to content

Commit

Permalink
Updated for recent SDL3 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 12, 2024
1 parent 7e04084 commit 8a5444d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion external/SDL
Submodule SDL updated 265 files
3 changes: 1 addition & 2 deletions include/SDL3_image/SDL_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#define SDL_IMAGE_H_

#include <SDL3/SDL.h>
#include <SDL3/SDL_version.h>
#include <SDL3/SDL_begin_code.h>

/* Set up for C function definitions, even when using C++ */
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/IMG.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/IMG_png.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/IMG_pnm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a5444d

Please sign in to comment.