From c70710cde8aec29bc4edd72118917e080196d528 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 6 Mar 2024 16:19:08 -0800 Subject: [PATCH] SDL_GetPixelFormatEnumForMasks() returns SDL_PixelFormatEnum --- include/SDL3/SDL_pixels.h | 4 ++-- src/dynapi/SDL_dynapi_procs.h | 2 +- src/render/software/SDL_render_sw.c | 2 +- src/video/SDL_bmp.c | 2 +- src/video/SDL_pixels.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 7a8a1313ce..6e430ed9d4 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -765,13 +765,13 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatE * \param Gmask the green mask for the format * \param Bmask the blue mask for the format * \param Amask the alpha mask for the format - * \returns one of the SDL_PixelFormatEnum values + * \returns the SDL_PixelFormatEnum value corresponding to the format masks, or SDL_PIXELFORMAT_UNKNOWN if there isn't a match. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetMasksForPixelFormatEnum */ -extern DECLSPEC Uint32 SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp, +extern DECLSPEC SDL_PixelFormatEnum SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index c78ceea203..0c84f92d96 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -337,7 +337,7 @@ SDL_DYNAPI_PROC(void,SDL_GetOriginalMemoryFunctions,(SDL_malloc_func *a, SDL_cal SDL_DYNAPI_PROC(char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceCounter,(void),(),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceFrequency,(void),(),return) -SDL_DYNAPI_PROC(Uint32,SDL_GetPixelFormatEnumForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(SDL_PixelFormatEnum,SDL_GetPixelFormatEnumForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormatEnum a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 66e0d0bf26..2ad9d86425 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -486,7 +486,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex * to be created. This makes all source pixels opaque and the colors get copied correctly. */ SDL_Surface *src_rotated_rgb; - int f = SDL_GetPixelFormatEnumForMasks(src_rotated->format->bits_per_pixel, + SDL_PixelFormatEnum f = SDL_GetPixelFormatEnumForMasks(src_rotated->format->bits_per_pixel, src_rotated->format->Rmask, src_rotated->format->Gmask, src_rotated->format->Bmask, diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 32c27b0109..6bf2977926 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -427,7 +427,7 @@ SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, SDL_bool freesrc) /* Create a compatible surface, note that the colors are RGB ordered */ { - Uint32 format; + SDL_PixelFormatEnum format; /* Get the pixel format */ format = SDL_GetPixelFormatEnumForMasks(biBitCount, Rmask, Gmask, Bmask, Amask); diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 08b3234f11..4f356cd048 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -333,7 +333,7 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Ui return SDL_TRUE; } -Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { switch (bpp) { case 1: