RE: [AD] small bug in 15 and 16 bit asm color converters

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


You'd normally do:

	Red8 = (red5 << 3) | (red5 >> 2);

This will replicate the upper bits of red5 into the bottom of red8. This
effectively makes 31 map to 255 and 0 map to 0.



> -----Original Message-----
> From: alleg-developers-admin@xxxxxxxxxx [mailto:alleg-
> developers-admin@xxxxxxxxxx] On Behalf Of Elias Pschernig
> Sent: Saturday, October 23, 2004 5:20 AM
> To: alleg-developers
> Subject: [AD] small bug in 15 and 16 bit asm color converters
> 
> The attached patch fixes a small bug in the 15 and 16 bit mmx color
> converters. The problem was, the rgb values only were shifted from
15/16
> bit to their 24bit positions. So all colors were kind of dark (e.g.
> 255/0/0 would become 248/0/0, or 255/255/255 would be 248/251/241 -
ugh,
> greenish gray instead of white) - but still, it was hard to notice.
> 
> For some unexplainable reason, the mouse background-update code wasn't
> affected by this - so the mouse would leave trails with the right
> color :) This probably suggest some bug with the mouse drawing - I'm a
> bit puzzled where exactly it is though. Somehow, it manages to escape
> the asm color converison.
> 
> --
> Elias Pschernig




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/