Re: [AD] getpixel conflict with alpha blended sprites

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


> Well, I don't know what is more widely used, but there is another
> question that is at least as relevant IMHO: now that both types of
> functionality can't live together, so that one has to go away, which one
> is easier to work around? To my knowledge the answer is: it is trivial
> to test manually if the pixel is outside the bitmap, but for general
> BITMAPs there is no other way to get the alpha value than via
> getpixel(). So that's an argument in favor of keeping the current
> behavior.

I think it is a bit voided by:

> I'd prefer adding a warning in the documentation for getpixel(), and
> possibly a simple function to test if a point is inside the clip
> rectangle, if anything.

because if we add a function to implement the feature we're going to remove 
from getpixel() (and I think we should), then the complexity will be 
entirely hidden from the user point-of-view in both cases.


That said, changing getpixel() woud probably be too damaging at this point 
and... I also note that we never promised to return -1 _only_ when the point 
lies outside the bitmap ;-)

So I agree to your proposition for a warning and a new helper function, which 
can be made inline.

-- 
Eric Botcazou




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