sprite.chȴsprite.cNHhdB@LLLPTEXTCWIEhȴ#include #include #include #include "sprite.h" #include "assert.h" void InitTIM(long address) { RECT rect; GsIMAGE imageInfo; assert(*((u_long*)address)==16); // +4 because we need to skip head of TIM file GsGetTimInfo((u_long*)(address+4), &imageInfo); rect.x = imageInfo.px; rect.y = imageInfo.py; rect.w = imageInfo.pw; rect.h = imageInfo.ph; LoadImage(&rect, imageInfo.pixel); // if image needs a CLUT, load it up // (pmode: 8 or 9 ==> texture is 4-bit or 8-bit) if ( (imageInfo.pmode>>3)&0x01) { rect.x = imageInfo.cx; rect.y = imageInfo.cy; rect.w = imageInfo.cw; rect.h = imageInfo.ch; LoadImage(&rect, imageInfo.clut); } // wait for loading to finish DrawSync(0); } void InitSpr(GsSPRITE* sprite) { sprite->attribute = 1<<24; sprite->cx = 320; sprite->cy = 511; sprite->r = sprite->g = sprite->b = 112; sprite->mx = sprite->my = 0; sprite->scalex = sprite->scaley = ONE; sprite->rotate = 0; }ZZRsprite.cocumentsx.harozentallerTEXTCWIEh]]ae`(hH Monaco=$=$ೱwc\ZZRtX1RMPSRMWBB*LR