Path: chuka.playstation.co.uk!news From: "Rad" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Filling the screen with boxes Date: Thu, 31 Dec 1998 18:56:41 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 54 Message-ID: <76gh2g$qsh13@chuka.playstation.co.uk> References: <762se1$2296@chuka.playstation.co.uk> <368741BC.84356107@hinge.mistral.co.uk> <76e75b$qsh7@chuka.playstation.co.uk> <368B5727.A7341FB5@hinge.mistral.co.uk> NNTP-Posting-Host: modem-93.lead.dialup.pol.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Craig Graham wrote in message <368B5727.A7341FB5@hinge.mistral.co.uk>... > >Rad wrote: > >> Shiney New Code Segment does it another way - though there is no one >> right way! > >The way that wastes memory by having 4800 * 16 = 76800bytes of memory >used up >by an un-needed static array of GsBOXF structures is almost certainly >the wrong way Not if for example you want boxes to represent pixels on the screen (i.e. 4x4 pixels = 1 box). Now you could declare 1 box and an array of 4800*16 integers to represent the pixels which would save you a bit more memory but it would be slower too because before you register the boxes into the ordering table you have to calculate each x, y and copy the value from the array to the box. Where as if you have enough memory to "waste" and would prefer the speed increase (no matter how slight) then it would probably be better to just declare the array of 4800*16 boxes and deal with them directly. Remember though there is no one right way, it all depends on what you want to do and how you want to do it. >- even if Shiney New Code Segment (tm) isn't the "one true way". In fact >it's all a bit cack >anyway, as 4800 box primitives is a serious waste of GPU time.....oh >well, never mind. > >> >#define BOX_WH 4 why restrict the box to having the same size >> width and height? > >Because, old mucker, it's what you did in your original post, so I >assumed that was what >you wanted yeah? OK point taken I just thought you were going for "All Out Shiney New Code Segment"! Anyway, if you re-read the original post, what I wanted was "to fill the screen (320x240) with boxes (GsBOXF)". The example code was just that, an example off the top of my head, which I admit wasn't the best piece of code but that wasn't it's purpose, it was supposed to back up my explaination just like an example should (although without the errors :-). Anyway my boxes are rectangular! As it happens the only problem was that I didn't allocate enough packet space. But hay, thanks for the responce anyway, and have a happy new year! Rad. rad@cyberdude.com http://www.netyaroze-europe.com/~radpsx