/**********************/ /*** JellyFish Legs ***/ /**********************/ #include "system\global.h" #include #include "utils\utils.h" #include "gfx\prim.h" #include "gfx\sprbank.h" #include #include "level\level.h" #include "FX\FXjfish.h" /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ void CFXJellyFishLegs::init() { CFX::init(); FXList=0; } /*****************************************************************************/ void CFXJellyFishLegs::shutdown() { MemFree(FXList); MemFree(WidthTable); MemFree(HeightTable); CFX::shutdown(); } /*****************************************************************************/ /*****************************************************************************/ void CFXJellyFishLegs::SetUp(int _Width,int _Gap,int _Length,int _Count) { XOfs=-(_Width/2); Width=_Width/_Gap; Gap=_Gap; Length=_Length; Count=_Count; FXList=(sList**)MemAlloc(Width*sizeof(sList*),"FishLegTable"); for (int L=0; L>12; } HeightTable=(s16*)MemAlloc(Width*sizeof(s16),"FishLegHTable"); int AInc=1024/Width; for (int H=0; H8) dH=8; HeightTable[H]=(s16)dH; printf("%i %i =%i\n",H,Ofs,HeightTable[H]); } } /*****************************************************************************/ /*** Think *******************************************************************/ /*****************************************************************************/ //int XT[]={-3,-3,-3,-2,-2,-2,-1,-1, +1,+1,+2,+2,+2,+3,+3,+3}; int XT[]={-3,-2,-2,-2,-2,-1,-1,-1, +1,+1,+1,+2,+2,+2,+2,+3}; void CFXJellyFishLegs::think(int _frames) { ASSERT(FXList); CFX::think(_frames); ListIdx--; if (ListIdx<0) ListIdx+=Count; for (int i=0; igetPos(); // ThisList[ListIdx].Ofs.vx/=16; // ThisList[ListIdx].Ofs.vy/=16; int XO=getRnd(); XO&=15; ThisList[ListIdx].Ofs.vx+=XT[XO]; } } /*****************************************************************************/ /*** Render ******************************************************************/ /*****************************************************************************/ int Trans=0; void CFXJellyFishLegs::render() { DVECTOR _MapOfs=CLevel::getCameraPos(); DVECTOR MapOfs; int dRGB=256/Count; s16 *dH=HeightTable; MapOfs.vx=_MapOfs.vx+XOfs; for (int L=0; L=Count) Idx=0; POLY_FT4 *Ft4=m_spriteBank->printFT4(FRM__TENTACLE,LastPos.vx,LastPos.vy,0,0,0); Ft4->x0=LastPos.vx+0+LastdW; Ft4->y0=LastPos.vy; Ft4->x1=LastPos.vx+8-LastdW; Ft4->y1=LastPos.vy; setSemiTrans(Ft4,1); Ft4->tpage|=Trans<<5; LastPos.vx=List[Idx].Ofs.vx-MapOfs.vx; LastPos.vy=List[Idx].Ofs.vy-MapOfs.vy; LastdW=*dW++; Ft4->x2=LastPos.vx+0+LastdW; Ft4->y2=LastPos.vy; Ft4->x3=LastPos.vx+8-LastdW; Ft4->y3=LastPos.vy; setRGB0(Ft4,C,C,C); C-=dRGB; MapOfs.vy-=Height; Idx++; } MapOfs.vx+=Gap; } } /* for (int i=0; i=Count) Idx=0; POLY *Ft4=m_spriteBank->printFT4(LastPos.vx,LastPos.vy); LINE_F2 *P=GetPrimLF2(); P->x0=LastPos.vx; P->y0=LastPos.vy; LastPos.vx=List[Idx].Ofs.vx-MapOfs.vx; LastPos.vy=List[Idx].Ofs.vy-MapOfs.vy; P->x1=LastPos.vx; P->y1=LastPos.vy; setRGB0(P,C,C,C); C-=dRGB; if (!i) setRGB0(P,255,0,0); AddPrim(OtPtr,P); MapOfs.vy-=Length; Idx++; } */