Path: chuka.playstation.co.uk!chuka.playstation.co.uk!chuka.playstation.co.uk!not-for-mail From: Lewis_Evans@Playstation.sony.com Newsgroups: scea.yaroze.programming.2d_graphics Subject: Problems displaying 2d sprites Date: 2 Apr 1998 09:29:56 +0100 Organization: Sony Computer Entertainment Europe - 119.SS5 Lines: 80 Sender: news@chuka.playstation.co.uk Message-ID: <6fvia4$5951@emeka.playstation.co.uk> Reply-To: Lewis_Evans@Playstation.sony.com NNTP-Posting-Host: emeka.playstation.co.uk via smtpd (for [194.203.13.2]) with SMTP; 2 Apr 1998 09:33:51 UT by camsg001.camb.scee.sony.co.uk (8.8.6/8.8.6) with SMTP id JAA10713 for ; Thu, 2 Apr 1998 09:33:37 +0100 (BST) From: Lewis_Evans@Playstation.sony.com To: news@playstation.co.uk I can't see your code for function ZeroSprite, but unless it allocates memory, you've got a straightforward bug caused by using memory you don't have; s1 is just a pointer to a GsSPRITE. If that's not it, there's the possiblity of something funny with u, v in function InitSprite; I can't see where these are declared or set values. Lewis I'm trying to display a 8-bit sprite, but I'm not getting any positive results. Currently it's displaying a half-screen of brown pixels. I attached the tim that I'm testing. Thanks Jeremy void DoTitle() { static int cmd = CMD_START; int Key = GetPad(PAD1, MODE_TITLE); GsSPRITE *s1; #ifdef DEBUG printf("Starting Title... Choose and Press START\n"); #endif FntLoad(960, 256); FntOpen( TEXT_TITLE_X, TEXT_TITLE_Y, TEXT_TITLE_W, TEXT_TITLE_H, 0, MAXLETTERS ); InitSprite(s1, TITLE_R, 0, 0); while( (Key = GetPad(PAD1, MODE_TITLE)) != PADstart){ activeBuff = GsGetActiveBuff(); GsSetWorkBase( (PACKET *)GpuPacketArea[activeBuff] ); GsClearOt(0, 0, &WorldOT[activeBuff]); GsSortFastSprite(s1, &WorldOT[activeBuff], 0); DrawSync(0); VSync(0); GsSwapDispBuff(); GsSortClear(0, 0, 0, &WorldOT[activeBuff]); GsDrawOt(&WorldOT[activeBuff]); FntPrint(Text[TEXT_TITLE]); FntFlush(-1); } } void InitSprite(GsSPRITE *s, long addr, int x, int y) { GsIMAGE tim; RECT r; ZeroSprite(s); GsGetTimInfo((u_long *)(addr+4), &tim); r.x = tim.px; r.y = tim.py; r.w = tim.pw; r.h = tim.ph; LoadImage(&r, tim.pixel); r.x = tim.cx; r.y = tim.cy; r.w = tim.cw; r.h = tim.ch; LoadImage(&r, tim.clut); s->attribute = 0x01000000; s->x = x; s->y = y; s->w = tim.pw * 2; s->h = tim.ph; s->tpage = GetTPage(1, 0, tim.px, tim.py); s->cx = tim.cx; s->cy = tim.cy; s->u = u; s->v = v; DrawSync(0); }