This commit is contained in:
parent
ff13d67687
commit
80a6c35255
@ -23,6 +23,7 @@ void CFXBubble::init(DVECTOR const &_Pos)
|
||||
Velocity.vy=-(getRndRange(4)+1);
|
||||
CurrentScaleX=CurrentScaleY=getRndRange(ONE/2)+(ONE/2);
|
||||
XIdx=getRnd()&15;
|
||||
if (!isOnScreen(_Pos)) setToShutdown();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -38,6 +38,7 @@ sLevelHdr *LevelHdr=CLevel::getLevelHdr();
|
||||
Velocity.vy=FallingTile_DefVY;
|
||||
Life=FallingTile_DefLife;
|
||||
CSoundMediator::playSfx(CSoundMediator::SFX_ANY_OBJECT_FALLING,false,true);
|
||||
if (!isOnScreen(_Pos)) setToShutdown();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1184,6 +1184,23 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
bool CThing::isOnScreen(DVECTOR Pos)
|
||||
{
|
||||
// Check Is Onscreen
|
||||
sBBox &ScrBBox=CThingManager::getRenderBBox();
|
||||
DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||
|
||||
Pos.vx-=CamPos.vx;
|
||||
Pos.vy-=CamPos.vy;
|
||||
|
||||
if (Pos.vx<ScrBBox.XMin) return(false);
|
||||
if (Pos.vx>ScrBBox.XMax) return(false);
|
||||
if (Pos.vy<ScrBBox.YMin) return(false);
|
||||
if (Pos.vy>ScrBBox.YMax) return(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
void CThing::calcRenderPos(DVECTOR const &Pos,DVECTOR &renderPos)
|
||||
{
|
||||
|
@ -151,6 +151,7 @@ virtual void render();
|
||||
u8 isSetToShutdown() {return( m_isShuttingDown);}
|
||||
virtual int dontKillDuringLevelRespawn() {return false;}
|
||||
void calcRenderPos(DVECTOR const &Pos,DVECTOR &renderPos);
|
||||
bool isOnScreen(DVECTOR Pos);
|
||||
|
||||
// Linkage
|
||||
void addChild(CThing *Child);
|
||||
|
Loading…
Reference in New Issue
Block a user