Re: [AD] offscreen sub bitmaps revisited

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


On Sat, 2010-06-26 at 02:00 -0500, Matthew Leverton wrote:
> On Fri, Jun 25, 2010 at 8:13 PM, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> > So would _al_draw_bitmap_region_memory need to be updated to clip sub-bitmaps?
> >
> Attached is a half-implemented patch for memory bitmaps. Maybe there
> is an easier way to implement this at a lower level...
> 

Could be. Or maybe this is the right place and we just should move
applying the transformations up to the driver-independent level. Then
the memory/opengl/directx functions already get the final source and
destination coordinates, all clipped and transformed.

The big advantage, the transformation and clipping would be done at one
and only one place.

Also, looking at the code, shouldn't the scaled and rotated drawing
functions just apply an additional transformation?

I say we should remove the vtable entries for scaled/rotated versions.
They were added before we had transformations but now they make no sense
any longer. al_draw_rotated_bitmap should just take the current
transformation, add the additional transform, then call the vtable entry
for drawing a transformed bitmap.

> The patch adds support for copying from an out-of-bounds sub-bitmap
> into an in-bounds sub-bitmap. Test with ex_subbitmap.
> 
> Scaling works, but transformations do not. After taking a look at the
> transformation code, I didn't even bother to try.

Shouldn't be hard to fix, just tedious because of all the duplicated
code we have in there - removing the scaled/rotated versions should make
it easier. You can apply the patch as is I'd say, will be more
motivation to fix things properly.

> It also doesn't work with bitmap flipping, but that's already screwed
> up (IMO) with sub-bitmaps as is.
> 

We really need a test app showing all the problems.

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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