This commit is contained in:
parent
61dcc5f131
commit
a9915cfb5d
2 changed files with 45 additions and 40 deletions
|
@ -42,7 +42,7 @@ void CNpcCheckpointHazard::init()
|
||||||
// m_spriteFrame = FRM__CHECKPOINT;
|
// m_spriteFrame = FRM__CHECKPOINT;
|
||||||
m_spriteFrame = 0; // Change by dave cos the checkpoint gfx aint there no more
|
m_spriteFrame = 0; // Change by dave cos the checkpoint gfx aint there no more
|
||||||
m_timer = 0;
|
m_timer = 0;
|
||||||
m_flick = false;
|
m_flick = 0;
|
||||||
|
|
||||||
m_scalableFont=new ("CheckpointFont") ScalableFontBank();
|
m_scalableFont=new ("CheckpointFont") ScalableFontBank();
|
||||||
m_scalableFont->initialise(&standardFont);
|
m_scalableFont->initialise(&standardFont);
|
||||||
|
@ -65,12 +65,17 @@ void CNpcCheckpointHazard::think(int _frames)
|
||||||
|
|
||||||
if ( m_timer <= 0 )
|
if ( m_timer <= 0 )
|
||||||
{
|
{
|
||||||
m_flick = false;
|
m_flick = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_scalableFont->setJustification(FontBank::JUST_CENTRE);
|
int HF=GameState::getOneSecondInFrames()>>1;
|
||||||
m_scalableFont->print( 256, 50, "Checkpoint!" );
|
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()
|
void CNpcCheckpointHazard::render()
|
||||||
{
|
{
|
||||||
|
@ -110,45 +120,39 @@ void CNpcCheckpointHazard::render()
|
||||||
|
|
||||||
CRECT polyArea;
|
CRECT polyArea;
|
||||||
|
|
||||||
polyArea.x1 = boundingBox.XMin + renderPos.vx;
|
polyArea.x1 = boundingBox.XMin;
|
||||||
polyArea.y1 = boundingBox.YMin + renderPos.vy;
|
polyArea.y1 = boundingBox.YMin;
|
||||||
polyArea.x2 = boundingBox.XMax + renderPos.vx;
|
polyArea.x2 = boundingBox.XMax;
|
||||||
polyArea.y2 = boundingBox.YMax + renderPos.vy;
|
polyArea.y2 = boundingBox.YMax;
|
||||||
|
polyArea.x1+=CPXO;
|
||||||
|
polyArea.x2-=CPXO;
|
||||||
|
polyArea.y1+=CPYO;
|
||||||
|
|
||||||
if ( polyArea.x1 < 0 )
|
u8 *PrimPtr=GetPrimPtr();
|
||||||
{
|
TPOLY_F4 *F4=(TPOLY_F4 *)PrimPtr;
|
||||||
polyArea.x1 = 0;
|
PrimPtr+=sizeof(TPOLY_F4);
|
||||||
}
|
SetPrimPtr((u8*)PrimPtr);
|
||||||
|
setTPolyF4(F4);
|
||||||
|
|
||||||
if ( polyArea.y1 < 0 )
|
F4->x0 = polyArea.x1; F4->y0 = polyArea.y1;
|
||||||
{
|
F4->x1 = polyArea.x2; F4->y1 = polyArea.y1;
|
||||||
polyArea.y1 = 0;
|
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);
|
||||||
|
|
||||||
if ( polyArea.x1 > scrnWidth )
|
setTSemiTrans(F4,1);
|
||||||
{
|
setTABRMode(F4,CPA);
|
||||||
polyArea.x1 = scrnWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( polyArea.y1 > scrnHeight )
|
setRGB0( F4, 255, 255, 0 );
|
||||||
{
|
|
||||||
polyArea.y1 = scrnHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
POLY_F4 *coverPoly;
|
AddPrimToList( F4, CPOT );
|
||||||
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);
|
((CPlayer*)_thisThing)->setRespawnPosAndRingTelephone(respawnPos);
|
||||||
m_triggered = true;
|
m_triggered = true;
|
||||||
m_timer = GameState::getOneSecondInFrames();
|
m_timer = GameState::getOneSecondInFrames();
|
||||||
m_flick = true;
|
m_flick = 3;
|
||||||
CLevel::setCurrentCheckpoint( this );
|
CLevel::setCurrentCheckpoint( this );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -114,7 +114,8 @@ void StartLoad(int _loadX,int _loadY)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void StopLoad()
|
void StopLoad()
|
||||||
{
|
{
|
||||||
#if !defined(__VERSION_DEBUG__)
|
|
||||||
|
#if defined(__USER_CDBUILD__)
|
||||||
while(LoadTime)
|
while(LoadTime)
|
||||||
{
|
{
|
||||||
VSync(0);
|
VSync(0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue