Re: [AD] minor issues

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


> > Probably best to provide an is_linear_bmp.. wait -
> > that function already exists. I wonder if it could just be used (and
> its
> > meaning extended to mean: linear bitmaps can have no line gaps).
>
> Well, the docs say this:
> "Historically there were only linear and planar  bitmaps  for  Allegro,
>   so  is_linear_bitmap() is actually an alias for !is_planar_bitmap()."
>
> What about making is_contiguous_bitmap for if the bitmap data is
> contiguous in memory?

Sounds fine to me...

> Maybe, but remember: memset only works properly on 8-bit bitmaps (and
> 24/32 if setting a shade of gray, and 16 if setting white or black
> only). If you try to pass a 16/24/32 bit value, it'll chop all but the
> LSB and copy that to every byte. AFAIK, there are asm instructions to
> copy 16 and 32-bit values en mass, but we'd have to supply functions for
> them.

stosw and stosd, in Intel syntax, if I recall correctly. It shouldn't be
too hard to implement a memset16 or memset32... some compilers already have
one, I assume.

Evert





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