/* * スプライト設定関数 MakeSpData() * * (C)1997 TPM.CO SOFT WORKS * * スプライトにしたいTIMデータのアドレスと * それをハンドルする GsSPRITEハンドラ名を渡す。 * * その後 GsSortSprite(&spr,&wot[active_buf],0); で実行。 * */ #include #include "sprite.h" #include "public.h" void MakeSpData(unsigned long* addr , GsSPRITE *sp) { GsIMAGE ut; RECT rc; GsGetTimInfo(addr,&ut); setRECT(&rc,ut.px,ut.py,ut.pw,ut.ph); LoadImage(&rc,ut.pixel); setRECT(&rc,ut.cx,ut.cy,ut.cw,ut.ch); LoadImage(&rc,ut.clut); /* clut をフレームバッファへ送る */ sp->attribute = ((ut.pmode&3)<<24) | (1<<30); sp->x = 0; sp->y = 0; sp->w = ut.pw*(4/((ut.pmode&3)+1)); sp->h = ut.ph; sp->tpage = GetTPage(1,0,ut.px,ut.py); sp->u = (ut.px%64)*2; sp->v = ut.py%256; sp->cx = ut.cx; sp->cy = ut.cy; sp->r = 128; sp->g = 128; sp->b = 128; sp->mx = ut.pw ; sp->my = (ut.ph)/2; sp->scalex = 4096; sp->scaley = 4096; sp->rotate = 0; }