Re: [AD] Renamed API second draft

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


Bob <ohannessian@xxxxxxxxxx> writes:

> Michael Bukin wrote:
> 
> [snip]
> > IMHO, it would be better to make 'foreign' bitmap type (and call it
> > AL_SPRITE, for example), because sprites and bitmaps are very
> > different things.
> 
> The idea was to allow the user to quickly switch in between regular bitmaps, 
> rle bitmaps and compiled bitmaps to see which one would be better for his 
> needs.

Then I agree with merging sprite types to bitmap type, in general.

> Finally, when converting the current Allegro code base to Allegro 5, we 
> would only support blit() with no clipping as the only operation that can be 
> performed, and probably disable writting to the bitmap too - until someone 
> wants to code the routines to do that :)

You are talking about bitmaps that were sprites in Allegro 4, right?
For 'sprites' it would be much simpler to only support conversion from
bitmap.  We still need to distinguish between blit and draw, if we
want to support drawing modes.  Or 'sprites' will obey drawing modes
in blit, while regular bitmaps will not, which will be misleading and
won't work for your idea of swapping bitmaps and sprites.  Or maybe
regular bitmaps will obey drawing modes too (but then it should be
called 'draw', not 'blit').

If "no clipping" above means "ignore width and height for blit
operation from 'sprite' to bitmap", then it is not useful IMHO,
because clipping is done for destination bitmap anyway, so 'sprites'
can support width and height too (and it won't be noticably slower,
IMHO).

BTW, maybe we should remove clipping at all?  Clipping can be done
by making subbitmaps of destination bitmap.  Making subbitmap is
slower than setting clipping (usually will affect one operation before
drawing a lot of things), but drawing without tests for clipping would
be faster (affects all drawing operations).  The only real advantage
of clipping against subbitmaps IMHO, is to set 'no clipping' mode.
If it is useful, then we can leave clip flag in AL_BITMAP, but remove
clipping ranges.

-- 
Michael Bukin



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