add hibernate (don't draw or update) to Actor

This commit is contained in:
Chris Danford
2004-02-02 01:10:56 +00:00
parent 0bff292827
commit 5b791f603b
5 changed files with 30 additions and 6 deletions
+12
View File
@@ -55,6 +55,7 @@ void Actor::Reset()
m_bShadow = false;
m_fShadowLength = 4;
m_bIsAnimating = true;
m_fHibernateSecondsLeft = 0;
m_bTextureWrapping = false;
m_BlendMode = BLEND_NORMAL;
@@ -75,6 +76,8 @@ void Actor::Draw()
{
if( m_bHidden )
return; // early abort
if( m_fHibernateSecondsLeft > 0 )
return; // early abort
// call the most-derived versions
this->BeginDraw();
@@ -295,6 +298,12 @@ void Actor::Update( float fDeltaTime )
{
// LOG->Trace( "Actor::Update( %f )", fDeltaTime );
m_fHibernateSecondsLeft -= fDeltaTime;
m_fHibernateSecondsLeft = max( 0, m_fHibernateSecondsLeft );
if( m_fHibernateSecondsLeft > 0 )
return;
// update effect
switch( m_Effect )
{
@@ -816,6 +825,7 @@ void Actor::HandleCommand( const ParsedCommand &command )
else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) );
else if( sName=="backfacecull" ) SetUseBackfaceCull( bParam(1) );
else if( sName=="hidden" ) SetHidden( bParam(1) );
else if( sName=="hibernate" ) SetHibernate( fParam(1) );
else if( sName=="playcommand" ) PlayCommand( sParam(1) );
/* These are commands intended for a Sprite commands, but they will get
@@ -848,6 +858,8 @@ float Actor::GetTweenTimeLeft() const
{
float tot = 0;
tot += m_fHibernateSecondsLeft;
for( unsigned i=0; i<m_TweenInfo.size(); ++i )
tot += m_TweenInfo[i].m_fTimeLeftInTween;