Date: Fri, 18 Apr 1997 07:08:30 -0500 (CDT) From: Andrew Deren To: The Flend cc: djgpp AT delorie DOT com Subject: Re: Accessing fields in structs in Allegro datafiles In-Reply-To: <5j61br$i8q@kew.globalnet.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 17 Apr 1997, The Flend wrote: > I am having some trouble with accessing the height of an rle_encoded sprite, > stored in Allegro 2.1 datafile. > > The datafile is: dataf_rle > > I've tried: > > (dataf_rle[spr_no].dat)->h Try something like this : RLE_SPRITE my_sprite; my_sprite = (RLE_SPRITE*)dataf_rle[spr_no].dat; //and then to find height use my_sprite->h; The other way to do this is casting dataf_rle[spr_no] to RLE_SPRITE ((RLE_SPRITE*)dataf_rle[spr_no].dat)->h; I am not really sure about this. I have never used REL_SPRITEs, but this works with BITMAPs. > > but it didn't seem to work. I'm sure the solution's blatently obvious, but I'm > none too experienced in C. > > If anyone could let me in on the soln I would be most chuffed. > Thanks. > -- > /\ The Flend > /--\---/ Email: flend AT globalnet DOT co DOT uk > \ / Colony Web Page: www.simsfam.demon.co.uk > \ 'Hard work never hurt anyone, but why take the chance?' > >