Re: [AD] compare ALLEGRO_COLOR with memcmp

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


On 2011-06-06, at 7:37 PM, AJ wrote:
> but his concern isn't with comparing first generation numbers.  its what happens when you compare first and twenty sixth.
> I'm sure the interwebs can find some examples,  I know pentium1 cpu can!

For his own code, sure, if he's manipulating ALLEGRO_COLOR internals. But think of where memcmp is used in Allegro 5.
al_convert_mask_to_alpha. You pass an al_map_rgba(r,g,b,a) to it, if you're calculating numbers from internals and passing
it to that function than you already know that's it's not going to work due to the nature of floating point numbers... All I'm saying
is al_convert_mask_to_alpha(bitmap, al_map_rgb(r, g, b)) will always work with memcmp (possibly won't if you're messing
with FPU settings, but you'd have to be doing that while doing al_convert_mask_to_alpha and that seems a little bit
unlikely).

Trent



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