Re: [AD] getpixel conflict with alpha blended sprites

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


On November 17, 2003 03:23 am, Eric Botcazou wrote:
> > However, if the bitmap has an alpha channel and happens to be fully
> > opaque and white (ie 32-bit colour value 0xFFFFFFFF) then it looks like
> > -1 to the code and aborts my function, thinking it's out of the bitmap's
> > area.
>
> Very classical problem.
>
> > So what I'm asking is, would it be ok to modify _linear_getpixel32 in
> > igfx32.s to automatically AND its return value with 0x00FFFFFF, to
> > effectively strip out the alpha channel? Or is there a better way around
> > this?
>
> I can't think of any. The same mask should be (conditionally) applied in
> src/c/cgfx.h and the documentation updated to reflect that getpixel()
> doesn't return the alpha channel (if any). Or, probably better, that all
> drawing primitives (as listed in "Drawing primitives" in the docs) don't
> take into account the alpha channel.
>

Or maybe they only touch the alpha when the set_write_alpha_blender() is in 
use?

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx
http://strangesoft.net





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