Re: [AD] clipping line algorithm

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


> OK, here's the situation as I see it (scroll down for new suggested
> solution):
> [...]

There's no discussion on that.

> One fix is to add a flag to bmp->id to mark the "other" bitmaps:
> BMP_ID_NONLINEAR_NONPLANAR. We would need new implementations of a
> couple of functions:
>
>     int is_linear_bitmap(BITMAP *bmp)
>     {
>        return (bmp->id & (BMP_ID_PLANAR | BMP_ID_NONLINEAR_NONPLANAR)) ?
>               TRUE : FALSE
>     }
>
>     int is_planar_bitmap(BITMAP *bmp)
>     {
>        return (bmp->id & BMP_ID_PLANAR) ? TRUE : FALSE;
>     }
>
> And rotate.c, gsprite.c and c/cstretch.c need modifications to take care
> of case (3).
>
> It is of course invalid for a bitmap to have both BMP_ID_PLANAR and
> BMP_ID_NONLINEAR_NONPLANAR flags set at the same time. Only add-ons like
> AllegroGL need to set the BMP_ID_NONLINEAR_NONPLANAR flag.
>
> I think that with this fix, any piece of code that currently assumes no
> bitmaps are of type (3) will still work fine with type (1) and (2)
> bitmaps. We can easily fix Allegro to allow case (3). Also, this
> solution does not imply any problems with flags saved on disk. What do
> you think?

I think this is interesting and could be worth implementing, but I'd like to 
hear from Bob before. One minor nit: the name of the flag is ugly :-)

So, basically, if this new flag is not set, the library would be allowed to 
bypass entirely the vtable of the bitmap? I'm still a bit uncomfortable with 
this idea.

-- 
Eric Botcazou




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