Skip to content

Commit

Permalink
Image module SDL3 support
Browse files Browse the repository at this point in the history
- Rework argument order of PG_CreateSurfaceFrom to match newest SDL3 (they changed it)
- Deal with all the pixelformat fallout throughout the file
- Fix TGA saving routine file writes
- Switch out SDL_SetPaletteColors (all colors) for SDL_SetSurfacePalette
  • Loading branch information
Starbuck5 committed Oct 11, 2024
1 parent 908d3ef commit 7524802
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 88 deletions.
6 changes: 3 additions & 3 deletions src_c/_pygame.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ PG_UnlockMutex(SDL_mutex *mutex)
return 0;
}

#define PG_SURF_BitsPerPixel(surf) surf->format->bits_per_pixel
#define PG_SURF_BytesPerPixel(surf) surf->format->bytes_per_pixel
#define PG_SURF_BitsPerPixel(surf) SDL_BITSPERPIXEL(surf->format)
#define PG_SURF_BytesPerPixel(surf) SDL_BYTESPERPIXEL(surf->format)
#define PG_FORMAT_BitsPerPixel(format) format->bits_per_pixel
#define PG_FORMAT_BytesPerPixel(format) format->bytes_per_pixel

Expand Down Expand Up @@ -138,7 +138,7 @@ PG_UnlockMutex(SDL_mutex *mutex)

#define PG_CreateSurface(width, height, format) \
SDL_CreateRGBSurfaceWithFormat(0, width, height, 0, format)
#define PG_CreateSurfaceFrom(pixels, width, height, pitch, format) \
#define PG_CreateSurfaceFrom(width, height, format, pixels, pitch) \
SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, format)
#define PG_ConvertSurface(src, fmt) SDL_ConvertSurface(src, fmt, 0)
#define PG_ConvertSurfaceFormat(src, pixel_format) \
Expand Down
Loading

0 comments on commit 7524802

Please sign in to comment.