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

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:

  • RGBA->RGB:
  • 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.

-Alex.
-------------- 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.txt

Updated patch attached. Never mind the previous one.

There are actually two problems addressed here. I was not sure if the
function was supposed to also mask off the alpha from the colorkey before
using it in comparisons, or if the colorkey was supposed to always be stored
w/o the alpha channel. Read more code – alpha has to be masked off from the
colorkey, so there it is.

-Alex.
-------------- 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/20051111/aa8ae2c5/attachment.txt