Re: [AD] clipping, sub bitmaps

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


On Sat, 2009-08-15 at 20:15 -0500, Matthew Leverton wrote:
> 
> My point is that it makes sense for a negative sub bitmap to be
> treated as if it existed in its entirety, as opposed to silently
> clipping it. So if a sub bitmap is positioned at -320,-240 of its
> parent, drawing to the sub-bitmap at 0,0 should give the same effect
> as drawing to -320,-240 of its parent.
> 
> The current behavior of clipping the top/left part of a sub-bitmap and
> shifting its origin makes no sense and is useless, in my opinion.
> 

I think we can add this, it shouldn't make the code more complicated. 

About the moving the origin, I assume you mean something like:

al_change_sub_bitmap_dimensions(bitmap, x, y, w, h)

I see how this could be quite useful - and wouldn't require any code
changes at other places. Are you going to create the patch to add it?

Also, since we are changing things like this, myself I often want
something like:

al_set_bitmap_offset(bitmap, x, y)

This would just be a convenience function adding -x/-y whenever the
bitmap is drawn (but if scaled or rotated, before the transformation).
It's quite convenient when you for example extend the size of one of
your sprite graphics to the left or top - but don't want the appearance
to change...

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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