slinga
Established Member
Reinhart's Animation
Hey Reinhart,
I've been trying for a while to display 2d sprites on the saturn. Your code seems to be the easiest to follow. Can you explain the following segments of code:
and
Also, can you give me some insights into how you converted your picture into a c array? toss? Thanks in advance, and excellent work on your animation. It would also help to have a very basic PDF, or doc, as a tutorial for newbs, similiar to Takashi's original document, but focusing only on displaying a single image.
Hey Reinhart,
I've been trying for a while to display 2d sprites on the saturn. Your code seems to be the easiest to follow. Can you explain the following segments of code:
Code:
/*----------------------------------------------------------------------*/
static void set_sprite(PICTURE *pcptr , Uint32 NbPicture)
{
TEXTURE *txptr;
for(; NbPicture-- > 0; pcptr++){
txptr = tex_spr + pcptr->texno;
slDMACopy((void *)pcptr->pcsrc,
(void *)(SpriteVRAM + ((txptr->CGadr) << 3)),
(Uint32)((txptr->Hsize * txptr->Vsize * 4) >> (pcptr->cmode)));
}
}
and
Code:
/*----------------------------------------------------------------------*/
static void disp_sprite(int SpriteNo)
{
slDispSprite((FIXED *)stat[SpriteNo], (SPR_ATTR *)(&attr[SpriteNo].texno), DEGtoANG(0));
}
[quote]
/*----------------------------------------------------------------------*/
Also, can you give me some insights into how you converted your picture into a c array? toss? Thanks in advance, and excellent work on your animation. It would also help to have a very basic PDF, or doc, as a tutorial for newbs, similiar to Takashi's original document, but focusing only on displaying a single image.