Mail Archives: djgpp/1997/03/10/09:57:21
Paul Derbyshire writes:
>I would be pleased if Allegro added an option to obtain the amount
>of memory a bitmap or sprite or music or sound resource is
>consuming. I.e. a bunch of functions such as:
>
>size_t size_of_bitmap (BITMAP *bmp)
This information is all easily available: just look at the definitions
of the structures. For a sample, it is:
sizeof(SAMPLE) + sample->len;
For a bitmap:
sizeof(BITMAP) + (bmp->h * sizeof(char *)) + (bmp->w * bmp->h);
RLE sprites, MIDI files, etc, can be measured in a similar manner...
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Beauty is a French phonetic corruption of a short cloth neck ornament.
*/
- Raw text -