www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/16/22:25:31

Sender: nate AT cartsys DOT com
Message-ID: <358716A0.B2D48A0B@cartsys.com>
Date: Tue, 16 Jun 1998 18:06:40 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Nicolas Blais <eletech AT netrover DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: [Allegro] Datafile problem HELP!
References: <35845170 DOT 2FA584AD AT netrover DOT com> <35849A36 DOT 6EC456F7 AT cartsys DOT com> <3585099D DOT 61E9984E AT netrover DOT com>

Nicolas Blais wrote:
> 
> Hi, thanks for helping, with your help I was able to fix the midi and font
> problem, but the bitmap problem still arises.  I tried what you told me to
> do but I can do so because show_centered_bmp is a call to a function I
> made.  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);

So the "Title_Main" object is a string? Okay then:

show_centered_bmp((char *)datafile[Title_Main].dat, 100);

Casts should be covered in any C++ book, and comp.lang.c++ would be a
better place for questions like this.
-- 

Nate Eldredge
nate AT cartsys DOT com


- Raw text -


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