Re: [AD] minor issues

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


Milan Mimica wrote:
sure, it's:
memset(bmp->line[0], 0, bitmap_color_depth(bmp) / CHAR_BITS * bmp->w * bmp->h);

Actually:

memset(bmp->line[0], 0, (bitmap_color_depth(bmp)+7) / 8 * bmp->w * bmp->h);

The previous way would treat 15-bit (and 12-bit) bitmaps the same size as 8-bit, and AFAIK Allegro already assumes CHAR_BITS == 8 so there's no need to make a define for it.




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