delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/10/09:57:21

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ALLEGRO suggestion
Date: Mon, 10 Mar 1997 09:58:27 +0000
Organization: None
Distribution: world
Message-ID: <0TV+zWADt9IzEwDY@talula.demon.co.uk>
References: <5g04it$pok AT freenet-news DOT carleton DOT ca>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019