Mail Archives: djgpp/1999/02/24/21:32:41
This is a multi-part message in MIME format.
--------------31841F27F664CF60087A9846
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Nate Eldredge wrote:
> Kevin Lang/Ultima wrote:
> >
> > Nate Eldredge wrote:
> >
> > > iso_map->tile_map[((iy<<(iso_map->ysize))+ix)].attributes
> > >
> > > Actually, it's quite simple. You can see that TILE.attributes is indeed
> > > an `int', so the compiler is quite justified.
> > >
> > > I assume what you want to do is read the contents of the `attributes'
> > > member from the packfile. `pack_fread' wants its first arg to be a
> > > pointer to the buffer into which to read. Therefore, all you need to do
> > > is take the address of this horrible expression (with the `&' operator)
> > > and pass that.
> >
> > Yes I sortof figured this out a little while after :-)But I don't get why I should use the .
> > operator instead of ->
> >
> > You are supposed to use -> when you are using a pointer to a struct right?
> > But tile_map is also a pointer to a struct, so how come the compiler wants me to put a . instead
> > of ->
>
> `tile_map' is a pointer, correct. However, `tile_map[nnn]' is not; it
> is one of the elements of `tile_map', which is an array. Each of these
> elements *is* a struct and not a pointer.
>
> It may help to know that `p[x]' is equivalent to `*(p+x)'.
Ah I understand now :-)
Thanks for the information!
> --
>
> Nate Eldredge
> nate AT cartsys DOT com
--
-=šUltimaš=-
WWW: http://www.game-master.com/ultima/
EMAIL: mailto:ultimaATgame-masterDOTcom (anti-spam)
ICQ: 12919201
Member and founder of StormTech SoftWare, visit our page today!
--------------31841F27F664CF60087A9846
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Kevin Lang
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Kevin Lang
n: Lang;Kevin
org: StormTech SoftWare
adr: ;;;;Quebec;;Canada
email;internet: ultima AT game-master DOT com
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------31841F27F664CF60087A9846--
- Raw text -