delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/18/08:36:22

Date: Fri, 18 Apr 1997 07:08:30 -0500 (CDT)
From: Andrew Deren <aderen AT eecs DOT uic DOT edu>
To: The Flend <flend AT globalnet DOT co DOT uk>
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: <Pine.SUN.3.95.970418070508.5520A-100000@bert.eecs.uic.edu>
MIME-Version: 1.0


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

- Raw text -


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