Re: [AD] getpixel conflict with alpha blended sprites

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


Thomas Fjellstrom wrote:

> > 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?

That's even more confusing, and the set_write_alpha_blender being in
use doesn't prevent one from trying to write outside the clipping
rectangle, does it? I'd suggest either passing the responsibility to
the user (with a function like point_within_clip_rect(bmp, x, y) or
using the bmp->... members) or, alternatively, setting an error flag
out_of_clip_rect to true. The latter is probably very ugly, but you
could use something like allegro_error for this. A third alternative
could be to return a double (to get 8 byte storage) with both the
error code and the the 4 color values encoded in it. You could use a
union to extract the values.

Hein Zelle

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
 Unix is user friendly. It's just very particular about who 
 it's friends are.

 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<




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