Path: chuka.playstation.co.uk!foo.mel.cybec.com.au!nobody From: Toby Hutton Newsgroups: scee.yaroze.beginners Subject: Re: Sprites, OTs and dodgy wrappers... Date: 30 Sep 1999 09:16:24 +1000 Organization: PlayStation Net Yaroze (SCEE) Lines: 31 Sender: toby@foo.mel.cybec.com.au Message-ID: <86n1u5jol3.fsf@foo.mel.cybec.com.au> References: <7su34m$7f82@chuka.playstation.co.uk> NNTP-Posting-Host: 203.103.154.60 X-Newsreader: Gnus v5.6.45/XEmacs 21.1 - "20 Minutes to Nikko" "Rikki Prince" writes: > Right, continued work on my dodgy wrapper functions etc have led me to > design a structure which has all the basic variables and structures I need > for the graphics and some main other variables. So basically, I've got a > structure with my Active Buffer tracker integer, my GPU Packet Area, OT, OT > Tags etc. I've got this working with a just a clear screen to blue, and it > all seems to work. However, when I try to add some code to display a > sprite - Initialisation and Display - it locks up. I've worked out that the > problem is with the call to GsSortSprite, where I pass the pointer to the > GsSPRITE struct, a pointer to the OT and a position in the OT. So as long as > the pointer to the sprite is ok, then it must be the pointer to the OT - > which could be a problem as it's inside another structure, as is the active > buffer int, which is used to select which of the OT array to use. At the > moment, I'm trying '&thisGame.ot[thisGame.ab]' where 'thisGame' is the > struct, ot within the struct is the GsOT array, and ab within the struct is > the active buffer int. This is where I believe the problem is, and would be > very grateful if anyone could shed some light on what I'm completely missing > (e.g.. can't use the OT struct inside another struct for one reason or > another, or something similar). Off the bat, again I can't stress how important it is to make your large variables (like struct thisgame) either static local or global. Secondly, having nested structs shouldn't matter as long as you're passing in the right values - do you have warnings turned all the way up with your compiler? This may help if you're not quite doing what you think you're doing :) Use the -Wall option with gcc, don't know for CW. -- Toby.