Path: chuka.playstation.co.uk!news From: Andrew Partington Newsgroups: scee.yaroze.freetalk.english Subject: Re: Pixel Perfect Collision Date: Fri, 04 Apr 2003 23:39:45 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 44 Message-ID: References: NNTP-Posting-Host: public2-ward1-6-cust140.oldh.broadband.ntl.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en In-Reply-To: Chris Wallace wrote: > I so wish u could edit messages... > Anyway, I dont need to collide anything that is scaled or rotated as it is > only for colliding the players ship with all tjhe scenery. > Whats the simplest way to do this? Which parts of the code in the tutorial > won't i need? > > Instead of using GsSortXYZ() to draw things to collide with into the VRAM area, you would just use MoveImage() instead since that is just a VRAM->VRAM copy - it may or may not be faster, i've not done any real benchmarking but I just assumed it would be slightly quicker than calling GsSortSprite() etc. If you were to just use MoveImage() then you wouldn't need to save/restore your drawing environment, and you'd save a little bit of memory by not having an extra ordering table. You would lose out on automatic sprite clipping however, so you'd have to be careful whereabouts in VRAM you MoveImage() your stuff to or else risk overwriting what's already there. You'd also lose the ability to use GsXYZ() calls (lines, sprites, boxes etc) to draw into that offscreen VRAM area without the extra OT and draw env. You could always combine the two approaches if you needed to. It's safe to completely remove the following lines if you're using GCC - they are only needed for CW users. // heap starts after the main program on a 16-byte boundary unsigned long lclHeapStart=(_end & 0xFFFFFFF0L)+0x10; // heap extends to the bottom of the stack. unsigned long lclHeapSize=((_stack_addr-(_stack_size<<10)) & 0xFFFFFFF0L)-lclHeapStart; InitHeap((unsigned long *)lclHeapStart, lclHeapSize); Hope this helps, Andy