Re: [AD] set_mask_color

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


On Tue, 2004-11-30 at 02:37 +1100, aj wrote:
> i remember  years'n'years'n'years ago..  maybe way back in the 3.12 days..
> i made the mask color for the 8 bit code a global var and then just set it 
> to which ever value i wanted.
> had to do something like  extern int _mask_color8;    somewhere..
> hehhee.. funny thing is, that code from those days is probably still in the 
> allegro src.
> 

Yes, many parts already could easily deal with it. There's also the
bitmap_mask_color funcion which is the preferred way to get the mask
color. I guess, really the only place is asm optimization of things like
masked_blit, where there's no register left to hold the mask color. But
we have an asm developer even less than a windows developer.

I wonder if this wouldn't have been a good use of self-modifying code,
at the time it was written, just put an immediate value into the asm
code where needed :)

But now, I guess a proper solution would be an mmx or the likes version,
which has the mask color in some extra register, or something like that.
Or is cached memory as fast as constants/registers?

-- 
Elias Pschernig





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