Const correctness patch for SDL_MapRGB and SDL_MapRGBA.
Fixes Bugzilla #421. --HG-- branch : SDL-1.2 extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402298
This commit is contained in:
parent
3a156ea6be
commit
3ce0d260d0
2 changed files with 11 additions and 5 deletions
|
@ -447,13 +447,15 @@ extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
|
||||||
* Maps an RGB triple to an opaque pixel value for a given pixel format
|
* Maps an RGB triple to an opaque pixel value for a given pixel format
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
|
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
|
||||||
(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b);
|
(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
|
* Maps an RGBA quadruple to a pixel value for a given pixel format
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(SDL_PixelFormat *format,
|
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
|
||||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
(const SDL_PixelFormat * const format,
|
||||||
|
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
|
* Maps a pixel value into the RGB components for a given pixel format
|
||||||
|
|
|
@ -337,7 +337,9 @@ Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the opaque pixel value corresponding to an RGB triple */
|
/* Find the opaque pixel value corresponding to an RGB triple */
|
||||||
Uint32 SDL_MapRGB(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
|
Uint32 SDL_MapRGB
|
||||||
|
(const SDL_PixelFormat * const format,
|
||||||
|
const Uint8 r, const Uint8 g, const Uint8 b)
|
||||||
{
|
{
|
||||||
if ( format->palette == NULL ) {
|
if ( format->palette == NULL ) {
|
||||||
return (r >> format->Rloss) << format->Rshift
|
return (r >> format->Rloss) << format->Rshift
|
||||||
|
@ -350,7 +352,9 @@ Uint32 SDL_MapRGB(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the pixel value corresponding to an RGBA quadruple */
|
/* Find the pixel value corresponding to an RGBA quadruple */
|
||||||
Uint32 SDL_MapRGBA(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
Uint32 SDL_MapRGBA
|
||||||
|
(const SDL_PixelFormat * const format,
|
||||||
|
const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)
|
||||||
{
|
{
|
||||||
if ( format->palette == NULL ) {
|
if ( format->palette == NULL ) {
|
||||||
return (r >> format->Rloss) << format->Rshift
|
return (r >> format->Rloss) << format->Rshift
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue