Path: chuka.playstation.co.uk!news From: "Peter Dollochan" Newsgroups: scee.yaroze.programming.2d_graphics,scee.yaroze.beginners Subject: Re: Trying to display a sprite Date: Wed, 24 Feb 1999 00:23:39 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 52 Message-ID: <7avh7s$9po2@chuka.playstation.co.uk> References: <7av5sm$9po1@chuka.playstation.co.uk> <7av7s5$8jb8@scea> NNTP-Posting-Host: modem-13.mallet.dialup.pol.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Xref: chuka.playstation.co.uk scee.yaroze.programming.2d_graphics:899 scee.yaroze.beginners:721 Hi all I think the addition is carried out before the cast so keep the +4 or it'll break :) apart from that Scott is right after the first draw your blank out the sprite and clut.. Pete. Charles Nicholson wrote in message <7av7s5$8jb8@scea>... >Umm... most of it looks pretty good- You might want to change the line in >InitSprite() that calls GsGetTimInfo though... > >Your first parameter, "(u_long *)(spriteAdd + 4)" should probably be changed >to >"(u_long *)(spriteAdd + 1)". > >The information that GetTimInfo needs is actually 4 bytes in from the >header. Since you're casting spriteAdd to a u_long, it will multiply any >addition you do (in this case +4) by the size of a u_long. The final offset >calculated (in bytes, not dwords) by "(u_long *)(spriteAdd + 4)" is 16 bytes >into spriteAdd. (u_long *)(spriteAdd + 1) will give you the proper 4 byte >advancement. > >This was a real pain for me too... :) > >hope i helped. >-charles > > > >>I've just typed out the code at the end of Ira Rainey's tutorial (typed, >not >>copied and pasted, to try and gain some experience, and extra knowledge >from >>doing so. However, I've compiled, and attempted to run, it flashes >something >>very quickly on the screen, and then the screen goes blank, with the thick >>black strips at the top and bottom. Anyway, I've attached the code, so if >>anyone has the chance to look at it, and tell me what's been copied >>incorrectly, or what's in the wrong order, etc. I would be very thankful. >> >>Rikki > > >