Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: "Charles Nicholson" Newsgroups: scee.yaroze.programming.2d_graphics,scee.yaroze.beginners Subject: Re: Trying to display a sprite Date: Tue, 23 Feb 1999 22:58:04 -0500 Organization: SCEA News Server Lines: 64 Message-ID: <7avte3$8jb9@scea> References: <7av5sm$9po1@chuka.playstation.co.uk> <7av7s5$8jb8@scea> <7avh7s$9po2@chuka.playstation.co.uk> NNTP-Posting-Host: chnicholson.vassar.edu X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Xref: chuka.playstation.co.uk scee.yaroze.programming.2d_graphics:900 scee.yaroze.beginners:722 heh... funny. I've been looking through all my code (just to double check at the chance of sounding like a fool), and it all has the sprite address + 1 inside the cast. Go figure- seems to work fine for me... :) ah well. -charles Peter Dollochan wrote in message <7avh7s$9po2@chuka.playstation.co.uk>... >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 >> >> >> > >