From ecdc352e963ef005a0829131f3491030abaaaeee Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Sun, 20 Oct 2013 16:34:19 -0400 Subject: [PATCH] Actor: propagate some default parameters --- src/Actor.cpp | 26 +++++++++--------- src/Actor.h | 51 +++++++++-------------------------- src/LifeMeterTime.cpp | 4 +-- src/ScreenRanking.cpp | 8 +++--- src/ScreenSelectCharacter.cpp | 2 +- src/WorkoutGraph.cpp | 2 +- 6 files changed, 33 insertions(+), 60 deletions(-) diff --git a/src/Actor.cpp b/src/Actor.cpp index 781fe776ae..f44e6ea4e6 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -1436,19 +1436,19 @@ public: static int vertalign( T* p, lua_State *L ) { p->SetVertAlign(Enum::Check(L, 1)); return 0; } static int halign( T* p, lua_State *L ) { p->SetHorizAlign(FArg(1)); return 0; } static int valign( T* p, lua_State *L ) { p->SetVertAlign(FArg(1)); return 0; } - static int diffuseblink( T* p, lua_State * ) { p->SetEffectDiffuseBlink(); return 0; } - static int diffuseshift( T* p, lua_State * ) { p->SetEffectDiffuseShift(); return 0; } - static int diffuseramp( T* p, lua_State * ) { p->SetEffectDiffuseRamp(); return 0; } - static int glowblink( T* p, lua_State * ) { p->SetEffectGlowBlink(); return 0; } - static int glowshift( T* p, lua_State * ) { p->SetEffectGlowShift(); return 0; } - static int glowramp( T* p, lua_State * ) { p->SetEffectGlowRamp(); return 0; } - static int rainbow( T* p, lua_State * ) { p->SetEffectRainbow(); return 0; } - static int wag( T* p, lua_State * ) { p->SetEffectWag(); return 0; } - static int bounce( T* p, lua_State * ) { p->SetEffectBounce(); return 0; } - static int bob( T* p, lua_State * ) { p->SetEffectBob(); return 0; } - static int pulse( T* p, lua_State * ) { p->SetEffectPulse(); return 0; } - static int spin( T* p, lua_State * ) { p->SetEffectSpin(); return 0; } - static int vibrate( T* p, lua_State * ) { p->SetEffectVibrate(); return 0; } + static int diffuseblink( T* p, lua_State * ) { p->SetEffectDiffuseBlink(1.0f, RageColor(0.5f,0.5f,0.5f,0.5f), RageColor(1,1,1,1)); return 0; } + static int diffuseshift( T* p, lua_State * ) { p->SetEffectDiffuseShift(1.0f, RageColor(0,0,0,1), RageColor(1,1,1,1)); return 0; } + static int diffuseramp( T* p, lua_State * ) { p->SetEffectDiffuseRamp(1.0f, RageColor(0,0,0,1), RageColor(1,1,1,1)); return 0; } + static int glowblink( T* p, lua_State * ) { p->SetEffectGlowBlink(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); return 0; } + static int glowshift( T* p, lua_State * ) { p->SetEffectGlowShift(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); return 0; } + static int glowramp( T* p, lua_State * ) { p->SetEffectGlowRamp(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); return 0; } + static int rainbow( T* p, lua_State * ) { p->SetEffectRainbow(2.0f); return 0; } + static int wag( T* p, lua_State * ) { p->SetEffectWag(2.0f, RageVector3(0,0,20)); return 0; } + static int bounce( T* p, lua_State * ) { p->SetEffectBounce(2.0f, RageVector3(0,20,0)); return 0; } + static int bob( T* p, lua_State * ) { p->SetEffectBob(2.0f, RageVector3(0,20,0)); return 0; } + static int pulse( T* p, lua_State * ) { p->SetEffectPulse(2.0f, 0.5f, 1.0f); return 0; } + static int spin( T* p, lua_State * ) { p->SetEffectSpin(RageVector3(0,0,180)); return 0; } + static int vibrate( T* p, lua_State * ) { p->SetEffectVibrate(RageVector3(10,10,10)); return 0; } static int stopeffect( T* p, lua_State * ) { p->StopEffect(); return 0; } static int effectcolor1( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetEffectColor1( c ); return 0; } static int effectcolor2( T* p, lua_State *L ) { RageColor c; c.FromStackCompat( L, 1 ); p->SetEffectColor2( c ); return 0; } diff --git a/src/Actor.h b/src/Actor.h index 327c161efc..13220c63cd 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -511,44 +511,19 @@ public: void SetEffectMagnitude( RageVector3 vec ) { m_vEffectMagnitude = vec; } RageVector3 GetEffectMagnitude() const { return m_vEffectMagnitude; } - void SetEffectDiffuseBlink( - float fEffectPeriodSeconds = 1.0f, - RageColor c1 = RageColor(0.5f,0.5f,0.5f,1), - RageColor c2 = RageColor(1,1,1,1) ); - void SetEffectDiffuseShift( float fEffectPeriodSeconds = 1.f, - RageColor c1 = RageColor(0,0,0,1), - RageColor c2 = RageColor(1,1,1,1) ); - void SetEffectDiffuseRamp( float fEffectPeriodSeconds = 1.f, - RageColor c1 = RageColor(0,0,0,1), - RageColor c2 = RageColor(1,1,1,1) ); - void SetEffectGlowBlink( float fEffectPeriodSeconds = 1.f, - RageColor c1 = RageColor(1,1,1,0.2f), - RageColor c2 = RageColor(1,1,1,0.8f) ); - void SetEffectGlowShift( - float fEffectPeriodSeconds = 1.0f, - RageColor c1 = RageColor(1,1,1,0.2f), - RageColor c2 = RageColor(1,1,1,0.8f) ); - void SetEffectGlowRamp( - float fEffectPeriodSeconds = 1.0f, - RageColor c1 = RageColor(1,1,1,0.2f), - RageColor c2 = RageColor(1,1,1,0.8f) ); - void SetEffectRainbow( - float fEffectPeriodSeconds = 2.0f ); - void SetEffectWag( - float fPeriod = 2.f, - RageVector3 vect = RageVector3(0,0,20) ); - void SetEffectBounce( - float fPeriod = 2.f, - RageVector3 vect = RageVector3(0,20,0) ); - void SetEffectBob( - float fPeriod = 2.f, - RageVector3 vect = RageVector3(0,20,0) ); - void SetEffectPulse( - float fPeriod = 2.f, - float fMinZoom = 0.5f, - float fMaxZoom = 1.f ); - void SetEffectSpin( RageVector3 vect = RageVector3(0,0,180) ); - void SetEffectVibrate( RageVector3 vect = RageVector3(10,10,10) ); + void SetEffectDiffuseBlink( float fEffectPeriodSeconds, RageColor c1, RageColor c2 ); + void SetEffectDiffuseShift( float fEffectPeriodSeconds, RageColor c1, RageColor c2 ); + void SetEffectDiffuseRamp( float fEffectPeriodSeconds, RageColor c1, RageColor c2 ); + void SetEffectGlowBlink( float fEffectPeriodSeconds, RageColor c1, RageColor c2 ); + void SetEffectGlowShift( float fEffectPeriodSeconds, RageColor c1, RageColor c2 ); + void SetEffectGlowRamp( float fEffectPeriodSeconds, RageColor c1, RageColor c2 ); + void SetEffectRainbow( float fEffectPeriodSeconds ); + void SetEffectWag( float fPeriod, RageVector3 vect ); + void SetEffectBounce( float fPeriod, RageVector3 vect ); + void SetEffectBob( float fPeriod, RageVector3 vect ); + void SetEffectPulse( float fPeriod, float fMinZoom, float fMaxZoom ); + void SetEffectSpin( RageVector3 vect ); + void SetEffectVibrate( RageVector3 vect ); // other properties diff --git a/src/LifeMeterTime.cpp b/src/LifeMeterTime.cpp index a113d26fae..e1ab91d844 100644 --- a/src/LifeMeterTime.cpp +++ b/src/LifeMeterTime.cpp @@ -71,9 +71,7 @@ void LifeMeterTime::Load( const PlayerState *pPlayerState, PlayerStageStats *pPl m_quadDangerGlow.ZoomToWidth( METER_WIDTH ); m_quadDangerGlow.ZoomToHeight( METER_HEIGHT ); // hardcoded effects... - m_quadDangerGlow.SetEffectDiffuseShift(); - m_quadDangerGlow.SetEffectColor1( RageColor(1,0,0,0.8f) ); - m_quadDangerGlow.SetEffectColor2( RageColor(1,0,0,0) ); + m_quadDangerGlow.SetEffectDiffuseShift( 1.0f, RageColor(1,0,0,0.8f), RageColor(1,0,0,0) ); m_quadDangerGlow.SetEffectClock( Actor::CLOCK_BGM_BEAT ); this->AddChild( &m_quadDangerGlow ); diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index 7788f97df8..3b78fbf86d 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -270,8 +270,8 @@ float ScreenRanking::SetPage( const PageToShow &pts ) if( bRecentHighScore ) { - m_textNames[l].SetEffectGlowBlink(0.1f); - m_textScores[l].SetEffectGlowBlink(0.1f); + m_textNames[l].SetEffectGlowBlink(0.1f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); + m_textScores[l].SetEffectGlowBlink(0.1f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); } else { @@ -321,8 +321,8 @@ float ScreenRanking::SetPage( const PageToShow &pts ) if( bRecentHighScore ) { - m_textNames[l].SetEffectGlowBlink(0.1f); - m_textScores[l].SetEffectGlowBlink(0.1f); + m_textNames[l].SetEffectGlowBlink(0.1f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); + m_textScores[l].SetEffectGlowBlink(0.1f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); } else { diff --git a/src/ScreenSelectCharacter.cpp b/src/ScreenSelectCharacter.cpp index f54c954759..401097b4a9 100644 --- a/src/ScreenSelectCharacter.cpp +++ b/src/ScreenSelectCharacter.cpp @@ -220,7 +220,7 @@ void ScreenSelectCharacter::AfterRowChange( PlayerNumber pn ) { case CHOOSING_CPU_CHARACTER: case CHOOSING_HUMAN_CHARACTER: - m_sprCardArrows[pnAffected].SetEffectGlowShift(); + m_sprCardArrows[pnAffected].SetEffectGlowShift(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); break; default: break; } diff --git a/src/WorkoutGraph.cpp b/src/WorkoutGraph.cpp index 601c2925e4..7865b05780 100644 --- a/src/WorkoutGraph.cpp +++ b/src/WorkoutGraph.cpp @@ -111,7 +111,7 @@ void WorkoutGraph::SetFromGameStateAndHighlightSong( int iSongIndex ) int iBarIndex = iSongIndex - m_iSongsChoppedOffAtBeginning; if( iBarIndex < (int)m_vpBars.size() ) - m_vpBars[iBarIndex]->SetEffectGlowBlink(0.3f); + m_vpBars[iBarIndex]->SetEffectGlowBlink(0.3f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); }