Merged r3007:3008 from branches/SDL-1.2: MapRGB/MapRGBA const correctness.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 04 Apr 2007 09:43:53 +0000
changeset 21020975e24a3670
parent 2101 c4e0afbcf1f6
child 2103 4a010418f3b9
Merged r3007:3008 from branches/SDL-1.2: MapRGB/MapRGBA const correctness.
include/SDL_video.h
src/video/SDL_pixels.c
     1.1 --- a/include/SDL_video.h	Wed Apr 04 09:36:25 2007 +0000
     1.2 +++ b/include/SDL_video.h	Wed Apr 04 09:43:53 2007 +0000
     1.3 @@ -1300,15 +1300,16 @@
     1.4  /*
     1.5   * Maps an RGB triple to an opaque pixel value for a given pixel format
     1.6   */
     1.7 -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
     1.8 -    (SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b);
     1.9 +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * const format,
    1.10 +                                          const Uint8 r, const Uint8 g,
    1.11 +                                          const Uint8 b);
    1.12  
    1.13  /*
    1.14   * Maps an RGBA quadruple to a pixel value for a given pixel format
    1.15   */
    1.16 -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(SDL_PixelFormat * format,
    1.17 -                                           Uint8 r, Uint8 g, Uint8 b,
    1.18 -                                           Uint8 a);
    1.19 +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * const fmt,
    1.20 +                                           const Uint8 r, const Uint8 g,
    1.21 +                                           const Uint8 b, const Uint8 a);
    1.22  
    1.23  /*
    1.24   * Maps a pixel value into the RGB components for a given pixel format
     2.1 --- a/src/video/SDL_pixels.c	Wed Apr 04 09:36:25 2007 +0000
     2.2 +++ b/src/video/SDL_pixels.c	Wed Apr 04 09:43:53 2007 +0000
     2.3 @@ -537,7 +537,8 @@
     2.4  
     2.5  /* Find the opaque pixel value corresponding to an RGB triple */
     2.6  Uint32
     2.7 -SDL_MapRGB(SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b)
     2.8 +SDL_MapRGB(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
     2.9 +           const Uint8 b)
    2.10  {
    2.11      if (format->palette == NULL) {
    2.12          return (r >> format->Rloss) << format->Rshift
    2.13 @@ -550,7 +551,8 @@
    2.14  
    2.15  /* Find the pixel value corresponding to an RGBA quadruple */
    2.16  Uint32
    2.17 -SDL_MapRGBA(SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
    2.18 +SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
    2.19 +            const Uint8 b, const Uint8 a)
    2.20  {
    2.21      if (format->palette == NULL) {
    2.22          return (r >> format->Rloss) << format->Rshift