Path: chuka.playstation.co.uk!news From: "Greg Cook" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Newbie needs basic help Date: Sun, 18 Nov 2001 15:32:03 +1300 Organization: PlayStation Net Yaroze (SCEE) Lines: 84 Message-ID: <9t76in$ob42@www.netyaroze-europe.com> References: <9t4jt2$ob41@www.netyaroze-europe.com> <01c16fc2$8b592ba0$2f3be4d5@pal-s-omnibook> NNTP-Posting-Host: 210-86-38-44.dialup.xtra.co.nz X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Thanks for the explanation of the struct stuff, thats great.. as for the second part.. i think i asked the question wrong. From looking at the reference manual how did you know to define the code below? GsOT_TAG WorldTags[2][NO_OF_SPRITES*sizeof(GsSPRITE)]; looking at the reference manual theres not example of how to define/use the structure, so how did you know to define it as 2d? i know the example code that sony has supplied shows it define like what is abo ve, but apart from seeing that would anyone of known how to define/use the structure. again not sure if im putting the question the right way, all im trying to say is i wouldnt of known to write the code like above from just looking at the reference manual ( i wouldnt of known to use 2 dimensions etc ) the only way i know how to do it is because theres a sample bit of code provided by sony.. anyways i'll keep playing Greg "pal" wrote in message news:01c16fc2$8b592ba0$2f3be4d5@pal-s-omnibook... > Hi Greg, > > 1. about the struct stuff: > > Compilers that are not overly old can treat 'x' as 'struct x' when > appropriate. This is standard Ansi C now I think (can't tell which precise > standard however ;) ). So in most cases you don't have to use the 'struct' > keyword other than when defining struct's. > > However... From what I've seen, the gcc which comes with NY does not allow > this. This can quickly get annoying. A common workaround is to use > typedef's for all your struct's definitions. This is the way libps's > struct's are defined (have a look at ). > > typedef struct { > ... > } X; > > Then you can use simply 'X' where you mean 'struct X' ('struct X' should > not work however). > This is not always possible but in most cases it's welcome. In some cases > you'll prefer: > > struct struct_X { > ... > }; > typedef struct_X X; > > PS beware to spell 'struct' in low case - 'Struct' and 'STRUCT' will be > understood as identifiers. > > 2. about the OT stuff: > > I cant tell *precisely*, and I'm not sure I understood the question, and > I'm sure someone will be able to answer that one better than me, but here > is how I understand it anyway: > > An OT needs a piece of memory to store its "things to draw" in. This piece > of memory is just a bunch of GsOT_TAG for convenience (if you can tell what > a GsOT_TAG is that is; to me it's just a bunch of bits). The second > dimension in your example is the amount of memory reserved for one OT. This > becomes clearer when in your code you need to initialize the GsOT's org > field: > > WorldOT[0].org = WorldTags[0]; > WorldOT[1].org = WorldTags[1]; > > so that you have 2 GsOT's, each one pointing to an array of N GsOT_TAG's > (in your case, N is NO_OF_SPRITES*sizeof(GsSPRITE)). > > hope this helps, > pal >