[SDL] BUG[?]: 32bpp RGBA->RGB colorkey blit, no SDL_SRCALPHA

Alex Volkov avcp-sdlmail at usa.net
Thu Nov 10 18:53:40 PST 2005

It seems there is either a documentation vs. reality mismatch or a real bug
in SDL_blit_N.c:BlitNtoNKey().
The exact blit in question is a 32bpp RGBA->RGB, where RGBA has SDL_COLORKEY
and *no* SDL_SRCALPHA flags. The doc in SDL_video.h states:
*     SDL_SRCALPHA not set:
* 	copy RGB.
* 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
* 	RGB values of the source colour key, ignoring alpha in the
* 	comparison. 

BlitNtoNKey(), however, forgets to "ignore alpha in the comparison". The
documentation makes perfect sense, so I think it is the code that is faulty.

The attached patch corrects the code.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: SDL_blit_N.patch.3.txt
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051110/d68d8a4e/attachment-0007.txt>

More information about the SDL mailing list