www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/17/01:30:37

Newsgroups: comp.os.msdos.djgpp
From: lamantia AT gte DOT net
Subject: Re: [Allegro] Datafile problem HELP!
Message-ID: <4405281F3585D111AEB500805FA6729704D36B@imsco3.imsco.com>
Sender: Chris La Mantia <chrisl AT tfepds DOT com>
Date: Tue, 16 Jun 1998 12:08:51 -0500
Lines: 25
References: <35845170 DOT 2FA584AD AT netrover DOT com> <35849A36 DOT 6EC456F7 AT cartsys DOT com> <3585099D DOT 61E9984E AT netrover DOT com>
NNTP-Posting-Host: pdsmail.socket.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> -----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 -


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