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 16:50:00 -0500 Organization: SCEA News Server Lines: 36 Message-ID: <7av7s5$8jb8@scea> References: <7av5sm$9po1@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:896 scee.yaroze.beginners:718 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