add base alpha

This commit is contained in:
Chris Danford
2005-04-30 07:48:10 +00:00
parent 8a1b17be68
commit 01d59d97ce
4 changed files with 31 additions and 3 deletions
+17 -1
View File
@@ -49,6 +49,7 @@ void Actor::Reset()
m_baseRotation = RageVector3( 0, 0, 0 );
m_baseScale = RageVector3( 1, 1, 1 );
m_fBaseAlpha = 1;
m_start.Init();
m_current.Init();
@@ -177,6 +178,8 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
{
DISPLAY->PushMatrix(); // we're actually going to do some drawing in this function
// Somthing below may set m_pTempState to m_tempState
m_pTempState = &m_current;
//
@@ -184,7 +187,6 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
//
if( m_Effect == no_effect )
{
m_pTempState = &m_current;
}
else if( m_Effect == effect_lua )
{
@@ -318,6 +320,20 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
}
}
if( m_fBaseAlpha != 1 )
{
if( m_pTempState != &m_tempState )
{
m_pTempState = &m_tempState;
m_tempState = m_current;
}
for( int i=0; i<4; i++ )
m_tempState.diffuse[i].a *= m_fBaseAlpha;
}
{
RageMatrix m;
RageMatrixTranslateAndScale( &m,
+4
View File
@@ -136,6 +136,7 @@ public:
void SetWidth( float width ) { m_size.x = width; }
void SetHeight( float height ) { m_size.y = height; }
// Base
float GetBaseZoomX() { return m_baseScale.x; }
void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; }
void SetBaseZoomY( float zoom ) { m_baseScale.y = zoom; }
@@ -145,6 +146,8 @@ public:
void SetBaseRotationY( float rot ) { m_baseRotation.y = rot; }
void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
void SetBaseRotation( const RageVector3 &rot ) { m_baseRotation = rot; }
virtual void SetBaseAlpha( float fAlpha ) { m_fBaseAlpha = fAlpha; }
float GetZoom() { return DestTweenState().scale.x; } // not accurate in some cases
float GetZoomX() { return DestTweenState().scale.x; }
@@ -384,6 +387,7 @@ protected:
RageVector3 m_baseRotation;
RageVector3 m_baseScale;
float m_fBaseAlpha;
RageVector2 m_size;
+9 -2
View File
@@ -222,12 +222,19 @@ PropagateActorFrameCommand( HurryTweening, float )
void ActorFrame::SetDiffuseAlpha( float f )
{
Actor::SetDiffuseAlpha( f );
/* set all sub-Actors */
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->SetDiffuseAlpha( f );
}
void ActorFrame::SetBaseAlpha( float f )
{
Actor::SetBaseAlpha( f );
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->SetBaseAlpha( f );
}
void ActorFrame::FinishTweening()
{
Actor::FinishTweening();
+1
View File
@@ -72,6 +72,7 @@ public:
virtual void SetDiffuse( RageColor c );
virtual void SetDiffuseAlpha( float f );
virtual void SetBaseAlpha( float f );
virtual void SetZTestMode( ZTestMode mode );
virtual void SetZWrite( bool b );