Mail Archives: djgpp/1998/06/17/01:30:37
> -----Original Message-----
>From: Nicolas Blais [SMTP:eletech AT netrover DOT com]
>Posted At: Monday, June 15, 1998 6:47 AM
>Subject: Re: [Allegro] Datafile problem HELP!
>
> I guess I have to modify something in my function, I tried putting
>(BITMAP *) everywhere but no success. Can you help one last time?
> > 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);
>
You are passing the wrong datatype to your function. Your function is
expecting a filename, but when you call it you are trying to pass an
already-loaded bitmap. You might want to try:
show_centered_bmp("mydata.dat#Title_Main", 100);
Of course, you should probably change the function prototype from:
void show_centered_bmp(char filename[20],int y)
to
void show_centered_bmp(char *filename,int y)
Does this help?
Regards,
--Chris
P.S. If this shows up as HTML or with an attachment, please let me
know; I'm not posting from my usual newsreader.
---------------------------------------------------
Chris La Mantia lamantia AT gte DOT net
http://home1.gte.net/lamantia
Current Project: Infinite Worlds, an RPG with a dynamic world
http://home1.gte.net/lamantia/infinite
- Raw text -