Propagate diffuse to ActorFrames' children
This commit is contained in:
+9
-1
@@ -91,6 +91,7 @@ void Actor::InitState()
|
||||
m_baseRotation = RageVector3( 0, 0, 0 );
|
||||
m_baseScale = RageVector3( 1, 1, 1 );
|
||||
m_fBaseAlpha = 1;
|
||||
m_internalDiffuse = RageColor( 1, 1, 1, 1 );
|
||||
m_internalGlow = RageColor( 0, 0, 0, 0 );
|
||||
|
||||
m_start.Init();
|
||||
@@ -187,6 +188,7 @@ Actor::Actor( const Actor &cpy ):
|
||||
CPY( m_baseRotation );
|
||||
CPY( m_baseScale );
|
||||
CPY( m_fBaseAlpha );
|
||||
CPY( m_internalDiffuse );
|
||||
CPY( m_internalGlow );
|
||||
|
||||
|
||||
@@ -449,6 +451,9 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
}
|
||||
|
||||
if( m_fBaseAlpha != 1 )
|
||||
m_internalDiffuse.a *= m_fBaseAlpha;
|
||||
|
||||
if( m_internalDiffuse != RageColor(1, 1, 1, 1) )
|
||||
{
|
||||
if( m_pTempState != &tempState )
|
||||
{
|
||||
@@ -457,7 +462,10 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
}
|
||||
|
||||
for( int i=0; i<4; i++ )
|
||||
tempState.diffuse[i].a *= m_fBaseAlpha;
|
||||
{
|
||||
tempState.diffuse[i] *= m_internalDiffuse;
|
||||
}
|
||||
m_internalDiffuse = RageColor(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
if( m_internalGlow.a > 0 )
|
||||
|
||||
@@ -343,6 +343,7 @@ public:
|
||||
void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
|
||||
void SetBaseRotation( const RageVector3 &rot ) { m_baseRotation = rot; }
|
||||
virtual void SetBaseAlpha( float fAlpha ) { m_fBaseAlpha = fAlpha; }
|
||||
void SetInternalDiffuse( const RageColor &c ) { m_internalDiffuse = c; }
|
||||
void SetInternalGlow( const RageColor &c ) { m_internalGlow = c; }
|
||||
|
||||
/**
|
||||
@@ -637,6 +638,7 @@ protected:
|
||||
RageVector3 m_baseRotation;
|
||||
RageVector3 m_baseScale;
|
||||
float m_fBaseAlpha;
|
||||
RageColor m_internalDiffuse;
|
||||
RageColor m_internalGlow;
|
||||
|
||||
RageVector2 m_size;
|
||||
|
||||
@@ -248,6 +248,7 @@ void ActorFrame::DrawPrimitives()
|
||||
ActorUtil::SortByZPosition( subs );
|
||||
for( unsigned i=0; i<subs.size(); i++ )
|
||||
{
|
||||
subs[i]->SetInternalDiffuse(m_pTempState->diffuse[0]);
|
||||
subs[i]->SetInternalGlow(m_pTempState->glow);
|
||||
subs[i]->Draw();
|
||||
}
|
||||
@@ -256,6 +257,7 @@ void ActorFrame::DrawPrimitives()
|
||||
{
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
{
|
||||
m_SubActors[i]->SetInternalDiffuse(m_pTempState->diffuse[0]);
|
||||
m_SubActors[i]->SetInternalGlow(m_pTempState->glow);
|
||||
m_SubActors[i]->Draw();
|
||||
}
|
||||
|
||||
@@ -636,14 +636,6 @@ void OptionRow::UpdateEnabledDisabled()
|
||||
}
|
||||
}
|
||||
|
||||
void OptionRow::Update( float fDeltaTime )
|
||||
{
|
||||
ActorFrame::Update( fDeltaTime );
|
||||
|
||||
float fAlpha = m_Frame.GetCurrentDiffuseAlpha();
|
||||
m_Frame.SetBaseAlpha( fAlpha );
|
||||
}
|
||||
|
||||
void OptionRow::SetModIcon( PlayerNumber pn, const RString &sText, GameCommand &gc )
|
||||
{
|
||||
// update row frame
|
||||
|
||||
@@ -55,7 +55,6 @@ class OptionRow : public ActorFrame
|
||||
public:
|
||||
OptionRow( const OptionRowType *pType );
|
||||
~OptionRow();
|
||||
void Update( float fDeltaTime );
|
||||
|
||||
void Clear();
|
||||
void LoadNormal( OptionRowHandler *pHand, bool bFirstItemGoesDown );
|
||||
|
||||
@@ -46,7 +46,7 @@ void ReceptorArrowRow::Update( float fDeltaTime )
|
||||
// m_fDark==1 or m_fFadeToFailPercent==1 should make fBaseAlpha==0
|
||||
float fBaseAlpha = (1 - m_pPlayerState->m_PlayerOptions.GetCurrent().m_fDark) * (1 - m_fFadeToFailPercent);
|
||||
CLAMP( fBaseAlpha, 0.0f, 1.0f );
|
||||
m_ReceptorArrow[c]->SetBaseAlpha( fBaseAlpha );
|
||||
SetBaseAlpha( fBaseAlpha );
|
||||
|
||||
// set arrow XYZ
|
||||
float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );
|
||||
|
||||
Reference in New Issue
Block a user