# HG changeset patch # User Ryan C. Gordon # Date 1175679833 0 # Node ID 0975e24a3670c9e334e72328e321080a3b29c209 # Parent c4e0afbcf1f6b4a49b4a436caa5024aa7b3b27b2 Merged r3007:3008 from branches/SDL-1.2: MapRGB/MapRGBA const correctness. diff -r c4e0afbcf1f6 -r 0975e24a3670 include/SDL_video.h --- a/include/SDL_video.h Wed Apr 04 09:36:25 2007 +0000 +++ b/include/SDL_video.h Wed Apr 04 09:43:53 2007 +0000 @@ -1300,15 +1300,16 @@ /* * Maps an RGB triple to an opaque pixel value for a given pixel format */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB - (SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b); +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, + const Uint8 b); /* * Maps an RGBA quadruple to a pixel value for a given pixel format */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * const fmt, + const Uint8 r, const Uint8 g, + const Uint8 b, const Uint8 a); /* * Maps a pixel value into the RGB components for a given pixel format diff -r c4e0afbcf1f6 -r 0975e24a3670 src/video/SDL_pixels.c --- a/src/video/SDL_pixels.c Wed Apr 04 09:36:25 2007 +0000 +++ b/src/video/SDL_pixels.c Wed Apr 04 09:43:53 2007 +0000 @@ -537,7 +537,8 @@ /* Find the opaque pixel value corresponding to an RGB triple */ Uint32 -SDL_MapRGB(SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b) +SDL_MapRGB(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g, + const Uint8 b) { if (format->palette == NULL) { return (r >> format->Rloss) << format->Rshift @@ -550,7 +551,8 @@ /* Find the pixel value corresponding to an RGBA quadruple */ Uint32 -SDL_MapRGBA(SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g, + const Uint8 b, const Uint8 a) { if (format->palette == NULL) { return (r >> format->Rloss) << format->Rshift