Re: [AD] compare ALLEGRO_COLOR with memcmp

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


On Tue, Jun 7, 2011 at 5:42 AM, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 6 Jun 2011, at 22:45 , Trent Gamblin wrote:
>> Well I have a reason too. I think there may be more than 1 place it's done, but I'm speaking of al_convert_mask_to_alpha specifically. That's a slow function. Comparing individual floats including an epsilon will make it even slower.
>
> That's the reason.
> Note that it would be much faster to compare one 32-bit integer (if all colour components were 8-bit integers). So from that argument, using chars to represent components would have been a better idea.
>

If you want to just lock the bitmap to RGBA first then you can do
32-bit integer compares. I believe the function was written before we
had the ability to lock to a specific format so if someone thinks it's
important could change it now.




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