Mail Archives: djgpp/1998/06/17/01:30:49
On Mon, 15 Jun 1998 17:49:41 -0400 in comp.os.msdos.djgpp Nicolas
Blais <eletech AT netrover DOT com> wrote:
: void show_centered_bmp(char filename[20],int y)
: {
: BITMAP* bmp;
: PALETTE pal;
: bmp = load_bmp(filename,pal);
: masked_blit(bmp,screen,0,0,(SCREEN_W-bmp->w)/2,y,bmp->w,bmp->h);
: destroy_bitmap(bmp);
: }
: show_centered_bmp(datafile[Title_Main].dat, 100);
Your function expects to be given a filename, and then loads, displays
and destroys the bitmap. However, you're passing it a pointer to an
already-existing bitmap. You have two choices:
a) Modify the function so that it takes the BITMAP * and just displays
it (no loading or destroying)
b) Modify the call so that it uses the syntax described in grabber.txt
to refer to objects in datafiles:
show_centered_bmp ("datafile.dat#Title_Main", 100);
perhaps -- it depends on the filename of the datafile and the object
name of the bitmap.
See the file `grabber.txt' in Allegro's `tools' subdirectory for
details.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html
- Raw text -