From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro Datafiles Date: Wed, 28 Jan 1998 19:13:47 +0000 Organization: None Distribution: world Message-ID: References: NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 22 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Matt Riker writes: >The normal format for drawing a sprite from the datafile is this: > >draw_sprite(doublebuffer, datafile[SPRITENAME].dat, 16, 16); > >But because SPRITENAME is constantly changing, I need to put in a >variable instead. So, put it in a variable! There is no problem with that. The object ID is just an integer value that is being used to index into the datafile array, so it can come from wherever you like. Your SPRITENAME symbol is #defined to a particular value in the header file that the grabber produces, but it is a normal numeric constant: there is nothing magical about it. See the ex21.c program for an example of how to compute the object ID for an animating sprite. -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ "Pigs use it for a tambourine" - Frank Zappa