Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.beginners,scee.yaroze.programming.codewarrior,scee.yaroze.programming.2d_graphics Subject: Re: Still strugglin' with the basics: broken sprite code (long) Date: Fri, 17 Jul 1998 09:42:22 +0100 Organization: Sony Computer Entertainment Europe Lines: 33 Message-ID: <35AF0E6E.3ECA2415@scee.sony.co.uk> References: <35AC71D4.AA79EB4A@easynet.co.uk> <35AD10B6.153EE9C5@compuserve.com> <35AD2E8E.DEF2C169@nospam.easynet.co.uk> <35ADFF08.A310D245@easynet.co.uk> <35AE05C6.489D09F9@scee.sony.co.uk> NNTP-Posting-Host: camfw01.millennium.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5b1 [en] (Win95; I) X-Accept-Language: en Xref: chuka.playstation.co.uk scee.yaroze.beginners:424 scee.yaroze.programming.codewarrior:307 scee.yaroze.programming.2d_graphics:448 Toby Hutton wrote: > > James Russell writes: > > > > > Philip Gooch wrote: > > > > > > Does the GsOT_TAG structure count as an enormous data structure? > > > > Generally, yes. > > > > > Is that why in this case it needed to be global (or static)? > > > > No. The reason it must be defined outside a function (or static) is because the GPU will be reading > > it (so it can draw the screen) while the CPU is off Doing Other Things. If GsOT_TAG was defined > > locally (and not static), its contents would be valid only for the 'life' of the function (the time > > spent inside the function) it is contained in. > > Ok. Hrmm. I had my OT defined locally in main() originally, crashed, > made it static, everything worked. So the 'life' of the variable had > nothing to do with it - I assumed it must've been too big. I'm right > in my case, aren't I? Well, there's a conflict of definition here - when I said "the time spent inside the function", I meant the time between when you enter the function and return from the function. Function calls made from that function are included in this time. Since you never return from the main() function until you exit the program, the time spent inside the function is equal to the life of the program! -- == James_Russell@scee.sony.co.uk +44 (171) 447-1626 == Developer Support Engineer - Sony Computer Entertainment Europe Two elephants fell off a cliff. Boom Boom.