From: "Edmund Horner" Newsgroups: comp.os.msdos.djgpp References: <39cd90d5_4 AT spamkiller DOT newsfeeds DOT com> Subject: Re: Passing a datafile to a function Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Organization: Paradise Net Message-ID: <969773968.146854@shelley.paradise.net.nz> Cache-Post-Path: shelley.paradise.net.nz!unknown AT 203-96-148-20 DOT tnt0 DOT paradise DOT net DOT nz X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: Sun, 24 Sep 2000 17:42:04 +1200 NNTP-Posting-Host: 203.96.152.26 X-Complaints-To: newsadmin AT xtra DOT co DOT nz X-Trace: news.xtra.co.nz 969773969 203.96.152.26 (Sun, 24 Sep 2000 17:39:29 NZST) NNTP-Posting-Date: Sun, 24 Sep 2000 17:39:29 NZST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Try this: int w = ((RLE_SPRITE *)image[map[0][0]].dat)->w; int h = ((RLE_SPRITE *)image[map[0][0]].dat)->h; I have added an extra pair of parantheses to each line. Edmund. "23yrold3yrold" wrote in message news:39cd90d5_4 AT spamkiller DOT newsfeeds DOT com... > Hello. I've been working on a tilemap drawing function using Allegro. I've > got it working beautifully except for one small detail; the function is > supposed to get the width and height of the tile sprite from the ->w and ->h > of the RLE_SPRITE in the datafile passed to it, but it won't work. The below > code results in an error, saying that I can't check the w and h values of > image.dat because it's a void pointer. If anyone can help me with this I'd > really appreciate it. > > > Chris > > void DrawTilemap(BITMAP *buffer, DATAFILE *image, vector > map, > int x = 0, int y = 0, int cl = 0, int repeat = 0) > { > ........ > int w = (RLE_SPRITE *)image[map[0][0]].dat->w; > int h = (RLE_SPRITE *)image[map[0][0]].dat->h; > ........ > } > >