add SetGlobalDiffuseColor, SetGlobalX, SetDiffuseAlpha

This commit is contained in:
Glenn Maynard
2003-06-16 20:00:10 +00:00
parent 5e1cde48fb
commit ad580a760d
2 changed files with 39 additions and 1 deletions
+35 -1
View File
@@ -717,7 +717,7 @@ void Actor::Command( CString sCommandString )
else if( sName=="diffusetopedge" ) SetDiffuseTopEdge( RageColor(fParam(1),fParam(2),fParam(3),fParam(4)) );
else if( sName=="diffusebottomedge" ) SetDiffuseBottomEdge( RageColor(fParam(1),fParam(2),fParam(3),fParam(4)) );
/* Add left/right/top/bottom for alpha if needed. */
else if( sName=="diffusealpha" ) { for(int i = 0; i < 4; ++i) { RageColor c = GetDiffuses( i ); c.a = fParam(1); SetDiffuses( i, c ); } }
else if( sName=="diffusealpha" ) SetDiffuseAlpha( fParam(1) );
else if( sName=="glow" ) SetGlow( RageColor(fParam(1),fParam(2),fParam(3),fParam(4)) );
else if( sName=="glowmode" ) {
if(!sParam(1).CompareNoCase("whiten"))
@@ -797,6 +797,40 @@ float Actor::GetTweenTimeLeft() const
return tot;
}
/* This is a hack to change all tween states while leaving existing tweens alone.
*
* Perhaps the regular Set methods should also take an optional parameter, eg.
* "SET_TWEEN" (normal behavior) or "SET_GLOBAL" to set regardless of tweens.
* That might be ugly, too.
*/
void Actor::SetGlobalDiffuseColor( RageColor c )
{
for(int i=0; i<4; i++) /* color, not alpha */
{
for( unsigned ts = 0; ts < m_TweenStates.size(); ++ts )
{
m_TweenStates[ts].diffuse[i].r = c.r;
m_TweenStates[ts].diffuse[i].g = c.g;
m_TweenStates[ts].diffuse[i].b = c.b;
}
m_current.diffuse[i].r = c.r;
m_current.diffuse[i].g = c.g;
m_current.diffuse[i].b = c.b;
m_start.diffuse[i].r = c.r;
m_start.diffuse[i].g = c.g;
m_start.diffuse[i].b = c.b;
}
}
void Actor::SetGlobalX( float x )
{
for( unsigned ts = 0; ts < m_TweenStates.size(); ++ts )
m_TweenStates[ts].pos.x = x;
m_current.pos.x = x;
m_start.pos.x = x;
}
void Actor::TweenState::Init()
{
pos = RageVector3( 0, 0, 0 );