RE: [AD] Question about 256 colors modes

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


> > I would suggest to add another function, something
> > like "set_masked_blit_color" to tell allegro which
> > color index is to be considered for transparency...
> > (which would allow to use other color than black as
> > "transparent").
> 
> I agree, also for truecolor bitmaps. We should add this to 
> the design of
> the new API.

Even if compares with zero can be made implicit in asm,
another advantage of having a hardcoded mask color is that
it is known at compile time, so generated code can include
this constant as immediates within instructions. Having
this as selectable (eg, a variable somewhere, probably in
the vtable or as a global) means you have to spare a register
for it in the blitting loop. You could make it self modifying
code (eg, set_mask_color(int) would poke the given color in
all the places it's used, and the baseline code would use a
complex enough constant as placeholder), but that somehow
doesn't seem like such a good idea.


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________




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