RE: [AD] set_mask_color

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


IIRC, some video drivers would not accelerate masked blits if the masked
color was anything but magic pink. I believe that was the reason we
didn't implement this before.

If you change the mask color, then that would mean that you may or may
not lose video acceleration. Considering that masked_blit() doesn't work
on video bitmaps if they're no accelerated, that enough reason to be
concerned.


> -----Original Message-----
> From: alleg-developers-admin@xxxxxxxxxx [mailto:alleg-
> developers-admin@xxxxxxxxxx] On Behalf Of Elias Pschernig
> Sent: Monday, November 29, 2004 12:50 PM
> To: alleg-developers@xxxxxxxxxx
> Subject: Re: [AD] set_mask_color
> 
> On Tue, 2004-11-30 at 06:38 +1100, aj wrote:
> > >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?
> >
> >
> > for a really really tight loop, like masked blit,  keeping it in a
> register
> > would be a good idea.
> > it does sound like a job for MMX.
> >
> > look  at
> > /alg_4_1_16/src/i386/iblit32.s     line  221
> >
> > movl $MASK_COLOR_32, %eax
> >
> > just change the
> > #define MASK_COLOR_32
> >
> > to
> >
> > volatile unsigned int MASK_COLOR_32 = 0xff00ff;
> >
> > then in the allegro.h  somewhere  but
> >
> > extern unsigned int MASK_COLOR_32;
> >
> > and the user can then set which ever colour they want.
> 
> Well, someone would need to find out if MASK_COLOR_32 is always used
> when the mask color is needed, or if some places use makecol(...). And
> also need to check if it in all cases is written to a register outside
> of a loop. I don't know too much asm, but I guess there could also be
> cmpl $MASK_COLOR_32, %eax. And in that case, you can't use a variable.
> But maybe that never i the case. Then, also need to check this for all
> other color depths. Actually, in 8-bit we could probably leave 0,
since
> I assume checking against 0 will always be faster in asm code than any
> other value. Well, and then, someone would need to create a patch with
> the change.
> 
> I put it into todo.txt as a wishlist item.
> 
> --
> Elias Pschernig
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers




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