add base alpha
This commit is contained in:
+17
-1
@@ -49,6 +49,7 @@ void Actor::Reset()
|
|||||||
|
|
||||||
m_baseRotation = RageVector3( 0, 0, 0 );
|
m_baseRotation = RageVector3( 0, 0, 0 );
|
||||||
m_baseScale = RageVector3( 1, 1, 1 );
|
m_baseScale = RageVector3( 1, 1, 1 );
|
||||||
|
m_fBaseAlpha = 1;
|
||||||
|
|
||||||
m_start.Init();
|
m_start.Init();
|
||||||
m_current.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
|
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 )
|
if( m_Effect == no_effect )
|
||||||
{
|
{
|
||||||
m_pTempState = &m_current;
|
|
||||||
}
|
}
|
||||||
else if( m_Effect == effect_lua )
|
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;
|
RageMatrix m;
|
||||||
RageMatrixTranslateAndScale( &m,
|
RageMatrixTranslateAndScale( &m,
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ public:
|
|||||||
void SetWidth( float width ) { m_size.x = width; }
|
void SetWidth( float width ) { m_size.x = width; }
|
||||||
void SetHeight( float height ) { m_size.y = height; }
|
void SetHeight( float height ) { m_size.y = height; }
|
||||||
|
|
||||||
|
// Base
|
||||||
float GetBaseZoomX() { return m_baseScale.x; }
|
float GetBaseZoomX() { return m_baseScale.x; }
|
||||||
void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; }
|
void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; }
|
||||||
void SetBaseZoomY( float zoom ) { m_baseScale.y = zoom; }
|
void SetBaseZoomY( float zoom ) { m_baseScale.y = zoom; }
|
||||||
@@ -145,6 +146,8 @@ public:
|
|||||||
void SetBaseRotationY( float rot ) { m_baseRotation.y = rot; }
|
void SetBaseRotationY( float rot ) { m_baseRotation.y = rot; }
|
||||||
void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
|
void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
|
||||||
void SetBaseRotation( const RageVector3 &rot ) { m_baseRotation = 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 GetZoom() { return DestTweenState().scale.x; } // not accurate in some cases
|
||||||
float GetZoomX() { return DestTweenState().scale.x; }
|
float GetZoomX() { return DestTweenState().scale.x; }
|
||||||
@@ -384,6 +387,7 @@ protected:
|
|||||||
|
|
||||||
RageVector3 m_baseRotation;
|
RageVector3 m_baseRotation;
|
||||||
RageVector3 m_baseScale;
|
RageVector3 m_baseScale;
|
||||||
|
float m_fBaseAlpha;
|
||||||
|
|
||||||
|
|
||||||
RageVector2 m_size;
|
RageVector2 m_size;
|
||||||
|
|||||||
@@ -223,11 +223,18 @@ void ActorFrame::SetDiffuseAlpha( float f )
|
|||||||
{
|
{
|
||||||
Actor::SetDiffuseAlpha( f );
|
Actor::SetDiffuseAlpha( f );
|
||||||
|
|
||||||
/* set all sub-Actors */
|
|
||||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||||
m_SubActors[i]->SetDiffuseAlpha( f );
|
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()
|
void ActorFrame::FinishTweening()
|
||||||
{
|
{
|
||||||
Actor::FinishTweening();
|
Actor::FinishTweening();
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public:
|
|||||||
|
|
||||||
virtual void SetDiffuse( RageColor c );
|
virtual void SetDiffuse( RageColor c );
|
||||||
virtual void SetDiffuseAlpha( float f );
|
virtual void SetDiffuseAlpha( float f );
|
||||||
|
virtual void SetBaseAlpha( float f );
|
||||||
|
|
||||||
virtual void SetZTestMode( ZTestMode mode );
|
virtual void SetZTestMode( ZTestMode mode );
|
||||||
virtual void SetZWrite( bool b );
|
virtual void SetZWrite( bool b );
|
||||||
|
|||||||
Reference in New Issue
Block a user