Commit df5650a8 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #421

Comment #3 From  esigra@gmail.com   2008-04-09 11:46:46   (-) [reply] -------

This bug also needs to be fixed for SDL_GetRGB and SDL_GetRGBA (those should
not change the format of the surface either). Until this is fixed, I still need
to const_cast the format parameter in calls to those functions.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403581
parent 3b082cfe
......@@ -460,13 +460,15 @@ 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,
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
const SDL_PixelFormat * const fmt,
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
/*
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment