BUG in copy_32(SDL_RLEaccel.c)?

copy_32 function in SDL_RLEaccel.c has below tow statement:--------------------------------------

PIXEL_FROM_RGB(pixel, dfmt, r, g, b);

*d++ = pixel | a << 24;


PIXEL_FROM_RGB is macro, it is defined in SDL_blit.h.


#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \

{ \

Pixel = ((r>>fmt->Rloss)<Rshift)| \

     ((g>>fmt->Gloss)<<fmt->Gshift)|       \

     ((b>>fmt->Bloss)<<fmt->Bshift)| \

     fmt->Amask;                       \

}


Basing PIXEL_FROM_RGB definition, when fmt->Amask is 0xff000000, then:

PIXEL_FROM_RGB(pixel, dfmt, r, g, b) will make bit[31, 24] of pixel variable
always 0xff!

pixel | a << 24, this operation does nothing!

On caller view, all translucent pixels change to opaque after RLE!

Code change to:


PIXEL_FROM_RGB(pixel, dfmt, r, g, b);

*d++ = (pixel & 0xffffff) | a << 24;


pixel | a << 24, this operation does nothing!

On caller view, all translucent pixels change to opaque after RLE!

Can you try the attached patch and see if it fixes this problem?

Thanks,
–ryan.

-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL13-rle32-alpha-fix-RYAN1.diff
Type: text/x-diff
Size: 817 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110822/ffb09ece/attachment.diff