From 88be4f43a953a72f4e89c63f345f05d37fc74fc9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 11 Jan 2004 05:33:24 +0000 Subject: [PATCH] add SetDiffuseAlpha simplify --- stepmania/src/ActorFrame.cpp | 49 +++++++++++------------------------- stepmania/src/ActorFrame.h | 3 ++- 2 files changed, 16 insertions(+), 36 deletions(-) diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 1afd12c236..0a82a0d37d 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -78,33 +78,21 @@ void ActorFrame::Update( float fDeltaTime ) (*it)->Update(fDeltaTime); } +#define PropagateActorFrameCommand( cmd, type ) \ + void ActorFrame::cmd( type f ) \ + { \ + Actor::cmd( f ); \ + \ + /* set all sub-Actors */ \ + for( unsigned i=0; icmd( f ); \ + } -void ActorFrame::SetDiffuse( RageColor c ) -{ - Actor::SetDiffuse( c ); - - // set all sub-Actors - for( unsigned i=0; iSetDiffuse(c ); -} - -void ActorFrame::SetZTest( bool b ) -{ - Actor::SetZTest( b ); - - // set all sub-Actors - for( unsigned i=0; iSetZTest( b ); -} - -void ActorFrame::SetZWrite( bool b ) -{ - Actor::SetZWrite( b ); - - // set all sub-Actors - for( unsigned i=0; iSetZWrite( b ); -} +PropagateActorFrameCommand( SetDiffuse, RageColor ) +PropagateActorFrameCommand( SetDiffuseAlpha, float ) +PropagateActorFrameCommand( SetZTest, bool ) +PropagateActorFrameCommand( SetZWrite, bool ) +PropagateActorFrameCommand( HurryTweening, float ) void ActorFrame::FinishTweening() { @@ -115,15 +103,6 @@ void ActorFrame::FinishTweening() m_SubActors[i]->FinishTweening(); } -void ActorFrame::HurryTweening( float factor ) -{ - Actor::HurryTweening( factor ); - - // set all sub-Actors - for( unsigned i=0; iHurryTweening( factor ); -} - float ActorFrame::GetTweenTimeLeft() const { float m = Actor::GetTweenTimeLeft(); diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index efb0ae7db2..0c714e84ad 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -27,7 +27,8 @@ public: virtual void DrawPrimitives(); virtual void SetDiffuse( RageColor c ); - + virtual void SetDiffuseAlpha( float f ); + virtual void SetZTest( bool b ); virtual void SetZWrite( bool b ); virtual void FinishTweening();