This commit is contained in:
Daveo 2001-08-03 21:44:31 +00:00
parent 61dcc5f131
commit a9915cfb5d
2 changed files with 45 additions and 40 deletions

View File

@ -42,7 +42,7 @@ void CNpcCheckpointHazard::init()
// m_spriteFrame = FRM__CHECKPOINT;
m_spriteFrame = 0; // Change by dave cos the checkpoint gfx aint there no more
m_timer = 0;
m_flick = false;
m_flick = 0;
m_scalableFont=new ("CheckpointFont") ScalableFontBank();
m_scalableFont->initialise(&standardFont);
@ -65,12 +65,17 @@ void CNpcCheckpointHazard::think(int _frames)
if ( m_timer <= 0 )
{
m_flick = false;
m_flick = 0;
}
else
{
m_scalableFont->setJustification(FontBank::JUST_CENTRE);
m_scalableFont->print( 256, 50, "Checkpoint!" );
int HF=GameState::getOneSecondInFrames()>>1;
if (m_timer<HF) m_flick^=2;
if (m_flick & 2)
{
m_scalableFont->setJustification(FontBank::JUST_CENTRE);
m_scalableFont->print( 256, 50, "Checkpoint!" );
}
}
}
}
@ -85,6 +90,11 @@ void CNpcCheckpointHazard::shutdown()
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int CPXO=18;
int CPYO=8;
int CPOT=13;
int CPA=3;
int CPZ=50;
void CNpcCheckpointHazard::render()
{
@ -110,45 +120,39 @@ void CNpcCheckpointHazard::render()
CRECT polyArea;
polyArea.x1 = boundingBox.XMin + renderPos.vx;
polyArea.y1 = boundingBox.YMin + renderPos.vy;
polyArea.x2 = boundingBox.XMax + renderPos.vx;
polyArea.y2 = boundingBox.YMax + renderPos.vy;
polyArea.x1 = boundingBox.XMin;
polyArea.y1 = boundingBox.YMin;
polyArea.x2 = boundingBox.XMax;
polyArea.y2 = boundingBox.YMax;
polyArea.x1+=CPXO;
polyArea.x2-=CPXO;
polyArea.y1+=CPYO;
if ( polyArea.x1 < 0 )
{
polyArea.x1 = 0;
}
u8 *PrimPtr=GetPrimPtr();
TPOLY_F4 *F4=(TPOLY_F4 *)PrimPtr;
PrimPtr+=sizeof(TPOLY_F4);
SetPrimPtr((u8*)PrimPtr);
setTPolyF4(F4);
if ( polyArea.y1 < 0 )
{
polyArea.y1 = 0;
}
F4->x0 = polyArea.x1; F4->y0 = polyArea.y1;
F4->x1 = polyArea.x2; F4->y1 = polyArea.y1;
F4->x2 = polyArea.x1; F4->y2 = polyArea.y2;
F4->x3 = polyArea.x2; F4->y3 = polyArea.y2;
long Tmp;
SVECTOR I;
I.vz=CPZ;
I.vx=polyArea.x1; I.vy=polyArea.y1; RotTransPers(&I,(long*)&F4->x0,&Tmp,&Tmp);
I.vx=polyArea.x2; I.vy=polyArea.y1; RotTransPers(&I,(long*)&F4->x1,&Tmp,&Tmp);
I.vx=polyArea.x1; I.vy=polyArea.y2; RotTransPers(&I,(long*)&F4->x2,&Tmp,&Tmp);
I.vx=polyArea.x2; I.vy=polyArea.y2; RotTransPers(&I,(long*)&F4->x3,&Tmp,&Tmp);
setTSemiTrans(F4,1);
setTABRMode(F4,CPA);
if ( polyArea.x1 > scrnWidth )
{
polyArea.x1 = scrnWidth;
}
setRGB0( F4, 255, 255, 0 );
if ( polyArea.y1 > scrnHeight )
{
polyArea.y1 = scrnHeight;
}
AddPrimToList( F4, CPOT );
POLY_F4 *coverPoly;
coverPoly = GetPrimF4();
coverPoly->x0 = polyArea.x1;
coverPoly->y0 = polyArea.y1;
coverPoly->x1 = polyArea.x2;
coverPoly->y1 = polyArea.y1;
coverPoly->x2 = polyArea.x1;
coverPoly->y2 = polyArea.y2;
coverPoly->x3 = polyArea.x2;
coverPoly->y3 = polyArea.y2;
setRGB0( coverPoly, 255, 255, 0 );
AddPrimToList( coverPoly, 0 );
}
}
}
@ -171,7 +175,7 @@ void CNpcCheckpointHazard::collidedWith(CThing *_thisThing)
((CPlayer*)_thisThing)->setRespawnPosAndRingTelephone(respawnPos);
m_triggered = true;
m_timer = GameState::getOneSecondInFrames();
m_flick = true;
m_flick = 3;
CLevel::setCurrentCheckpoint( this );
break;

View File

@ -114,7 +114,8 @@ void StartLoad(int _loadX,int _loadY)
/*****************************************************************************/
void StopLoad()
{
#if !defined(__VERSION_DEBUG__)
#if defined(__USER_CDBUILD__)
while(LoadTime)
{
VSync(0);