From b9e910019a9f092f046e635277c11d50b4a74785 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 17 Nov 2003 00:51:35 +0000 Subject: [PATCH] add SetDiffuseColor (SetDiffuseAlpha's brother) --- stepmania/src/Actor.cpp | 11 +++++++++++ stepmania/src/Actor.h | 1 + 2 files changed, 12 insertions(+) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index b33a59344e..2946471bb9 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -754,6 +754,7 @@ void Actor::HandleCommand( const CStringArray &asTokens ) 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" ) SetDiffuseAlpha( fParam(1) ); + else if( sName=="diffusecolor" ) SetDiffuseColor( RageColor( fParam(1),fParam(2),fParam(3),1 ) ); else if( sName=="glow" ) SetGlow( RageColor(fParam(1),fParam(2),fParam(3),fParam(4)) ); else if( sName=="glowmode" ) { if(!sParam(1).CompareNoCase("whiten")) @@ -864,6 +865,16 @@ void Actor::SetGlobalX( float x ) m_start.pos.x = x; } +void Actor::SetDiffuseColor( RageColor c ) +{ + for(int i=0; i<4; i++) + { + DestTweenState().diffuse[i].r = c.r; + DestTweenState().diffuse[i].g = c.g; + DestTweenState().diffuse[i].b = c.b; + } +} + void Actor::TweenState::Init() { diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index f29a24d36f..227c5a1335 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -156,6 +156,7 @@ public: virtual void SetDiffuse( RageColor c ) { for(int i=0; i<4; i++) DestTweenState().diffuse[i] = c; }; virtual void SetDiffuseAlpha( float f ) { for(int i = 0; i < 4; ++i) { RageColor c = GetDiffuses( i ); c.a = f; SetDiffuses( i, c ); } } + virtual void SetDiffuseColor( RageColor c ); virtual void SetDiffuses( int i, RageColor c ) { DestTweenState().diffuse[i] = c; }; virtual void SetDiffuseUpperLeft( RageColor c ) { DestTweenState().diffuse[0] = c; }; virtual void SetDiffuseUpperRight( RageColor c ) { DestTweenState().diffuse[1] = c; };