Path: chuka.playstation.co.uk!news From: "Rad" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Filling the screen with boxes Date: Sun, 27 Dec 1998 02:02:19 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 77 Message-ID: <76454k$22910@chuka.playstation.co.uk> References: <762se1$2296@chuka.playstation.co.uk> <763r2u$2299@chuka.playstation.co.uk> NNTP-Posting-Host: modem-15.bismuth.dialup.pol.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Doh! I too have fallen victim to allocating insufficient packet space and after I said "I've made sure my gpu packet area is big enough"!!! Ok, thanks anyway Mario. Mario Wynands wrote in message <763r2u$2299@chuka.playstation.co.uk>... >> >>// declaration >> >>GsBOXF box[80][60]; > > >You probably don't need to do this. Using a single GsBOXF structure and >modifying the attributes on the fly within your drawing loop will save a lot >of memory (once you use a structure to put stuff in an ordering table you >can modify its attributes and reuse it without affect previous entries in >the ordering table). Same principle also works for sprites etc. > I need to store the values and reuse them for the next frame. Although I could save a small amount of memory by using one GsBOXF variable and defining an array of integers i.e. int box[80][60]; but this would be slightly slower because I would have to copy the values from each array into the GsBOXF variable before registering it into the odering table. >>// drawing >> >>for (y = 0; y < 240; y++) // this needs to be "for (y = 12; < 240; >>y++) " to work >> for (x = 0; x < 320; x++) >> GsSortBoxFill(&box[x][y], &WorldOT[acvtiveBuffer],0); > > >This doesn't look right. Given the array declaration at the top you are >overstepping the boundaries of your array (80x60) using this loop (320x240). >Something like Yeah, this is wrong but only in this example. >Also, for slightly more flexible code try using 'defines' a bit more. That >way when you change the parameters of your algorithm you don't have to go >through your code and change stuff everywhere. Again I do use defines, I just didn't use them in the example as I wanted to keep it short. >Hope this helps > Yep, it made me have one last look at my code after hours of trying to figure out why it didn't work! > >Mario Wynands > >Director/Project Manager, Sidhe Interactive >Sony Playstation Software Development House > >Email mario@sidhe.co.nz Website www.sidhe.co.nz > Thanks again, Rad. rad@cyberdude.com http://www.netyaroze-europe.com/~radpsx BTW what are you guys up to at Sidhe Interactive?