/*========================================================================= fader.cpp Author: PKG Created: Project: Spongebob Purpose: Copyright (c) 2000 Climax Development Ltd ===========================================================================*/ /*---------------------------------------------------------------------- Includes -------- */ #include "fader.h" #ifndef __PRIM_HEADER__ #include "gfx\prim.h" #endif #ifndef __GFX_BUBICLES_H__ #include "gfx\bubicles.h" #endif /* Std Lib ------- */ /* Data ---- */ /*---------------------------------------------------------------------- Tyepdefs && Defines ------------------- */ /*---------------------------------------------------------------------- Structure defintions -------------------- */ /*---------------------------------------------------------------------- Function Prototypes ------------------- */ /*---------------------------------------------------------------------- Vars ---- */ int CFader::s_fadeLine=0; CFader::FADE_MODE CFader::s_fadeMode=FADED_IN; /*---------------------------------------------------------------------- Function: Purpose: Params: Returns: ---------------------------------------------------------------------- */ BubicleEmitterData s_fadeBubicleSpawner= { 0,0,512,40, // m_x,m_y,m_w,m_h 0,0, // m_birthRate,m_birthAmount 0, // m_life // m_bubicleBase { 10, // m_life 0,0,0, // m_vx,m_vdx,m_vxmax -200,0,0, // m_vy,m_vdy,m_vymax 18,12, // m_w,m_h 0, // m_dvSizeChange 0,0, // m_theta,m_vtheta 0,0,0, // m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth 0, // m_ot {20,20,20} // m_colour }, // m_bubicleRange; { 10, // m_life 0,0,0, // m_vx,m_vdx,m_vxmax 50,0,0, // m_vy,m_vdy,m_vymax 3,3, // m_w,m_h 0, // m_dvSizeChange 0,100, // m_theta,m_vtheta 10,0,0, // m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth 0, // m_ot {30,30,30} // m_colour } }; void CFader::render() { switch(s_fadeMode) { case FADED_IN: return; case FADING_IN: { if(s_fadeLine>0) { POLY_F4 *f4; POLY_G4 *g4; POLY_FT3 *ft3; f4=GetPrimF4(); setXYWH(f4,0,-FADE_BORDER_SIZE,512,s_fadeLine-(FADE_SMOOTH_BORDER_SIZE/2)+FADE_BORDER_SIZE); setRGB0(f4,255,255,255); AddPrimToList(f4,0); g4=GetPrimG4(); setXYWH(g4,0,s_fadeLine-(FADE_SMOOTH_BORDER_SIZE/2),512,FADE_SMOOTH_BORDER_SIZE); setRGB0(g4,255,255,255); setRGB1(g4,255,255,255); setRGB2(g4,0,0,0); setRGB3(g4,0,0,0); setShadeTex(g4,0); setSemiTrans(g4,1); AddPrimToList(g4,0); ft3=GetPrimFT3(); setShadeTex(ft3,1); setSemiTrans(ft3,1); ft3->tpage=(1<<5); setXY3(ft3,512,512,512,512,512,512); AddPrimToList(ft3,0); } } break; case FADING_OUT: { POLY_F4 *f4; POLY_G4 *g4; POLY_FT3 *ft3; f4=GetPrimF4(); setXYWH(f4,0,s_fadeLine+(FADE_SMOOTH_BORDER_SIZE/2),512,256-s_fadeLine-(FADE_SMOOTH_BORDER_SIZE/2)); setRGB0(f4,255,255,255); AddPrimToList(f4,0); g4=GetPrimG4(); setXYWH(g4,0,s_fadeLine-(FADE_SMOOTH_BORDER_SIZE/2),512,FADE_SMOOTH_BORDER_SIZE); setRGB0(g4,0,0,0); setRGB1(g4,0,0,0); setRGB2(g4,255,255,255); setRGB3(g4,255,255,255); setShadeTex(g4,0); setSemiTrans(g4,1); AddPrimToList(g4,0); ft3=GetPrimFT3(); setShadeTex(ft3,1); setSemiTrans(ft3,1); ft3->tpage=(1<<5); setXY3(ft3,512,512,512,512,512,512); AddPrimToList(ft3,0); } break; case FADED_OUT: { POLY_F4 *f4; f4=GetPrimF4(); setXYWH(f4,0,0,512,256); setRGB0(f4,255,255,255); AddPrimToList(f4,1); return; } } s_fadeBubicleSpawner.m_y=s_fadeLine-20; for(int i=0;i