[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] minor issues
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Wed, 26 Jan 2005 15:32:10 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=buvWO/A5vpimA+PmFFg94WlFvUjAr6z7Wugq873CLrlM1Kk5eLRiLNN3WiJS2589U7WjET8oeEc/5w2ua4e+vIJB1nsWcFvHj6fKVsOgzBBhDB3NlXnR3UtXZUrxvrcjf0Rh0XgzHgYLzs7e6jnXBt3+Jsqa80rFSi6S2OuuZOs=
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.