diff --git a/include/SDL_video.h b/include/SDL_video.h index 7e3708ac9..9627f0987 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -460,14 +460,16 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA /* * Maps a pixel value into the RGB components for a given pixel format */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * const fmt, Uint8 *r, Uint8 *g, Uint8 *b); /* * Maps a pixel value into the RGBA components for a given pixel format */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, - Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /* * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 841377f4c..47bbd7f9b 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -366,7 +366,7 @@ Uint32 SDL_MapRGBA } } -void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, +void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * const fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { if ( fmt->palette == NULL ) { @@ -400,7 +400,8 @@ void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, } } -void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r,Uint8 *g,Uint8 *b) +void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * const fmt, + Uint8 *r,Uint8 *g,Uint8 *b) { if ( fmt->palette == NULL ) { /* the note for SDL_GetRGBA above applies here too */