1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-07 12:57:57 +00:00

migrated to SDL3

This commit is contained in:
Zeno Rogue
2025-06-07 16:16:57 +02:00
parent 41ffba600f
commit a80b74dc62
25 changed files with 435 additions and 235 deletions

View File

@@ -18,8 +18,13 @@ extern "C" { /* This helps CPP projects that include this header */
* Returns 0 success or -1 on failure, the error message is then retrievable
* via SDL_GetError().
*/
#if SDLVER >= 3
#define SDL_SavePNG(surface, file) \
SDL_SavePNG_RW(surface, SDL_IOFromFile(file, "wb"), 1)
#else
#define SDL_SavePNG(surface, file) \
SDL_SavePNG_RW(surface, SDL_RWFromFile(file, "wb"), 1)
#endif
/*
* Save an SDL_Surface as a PNG file, using writable RWops.
@@ -31,7 +36,11 @@ extern "C" { /* This helps CPP projects that include this header */
* Returns 0 success or -1 on failure, the error message is then retrievable
* via SDL_GetError().
*/
#if SDLVER >= 3
extern int SDL_SavePNG_RW(SDL_Surface *surface, SDL_IOStream *rw, int freedst);
#else
extern int SDL_SavePNG_RW(SDL_Surface *surface, SDL_RWops *rw, int freedst);
#endif
/*
* Return new SDL_Surface with a format suitable for PNG output.