From 55da51678da6cddc46a75fedea0b7e20b2d43780 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 19 Dec 2010 14:29:25 -0600 Subject: [PATCH] [StreamDisplay] Remove UseThreePartMethod --- Docs/Changelog_sm-ssc.txt | 1 + src/StreamDisplay.cpp | 56 +++++---------------------------------- src/StreamDisplay.h | 2 -- 3 files changed, 7 insertions(+), 52 deletions(-) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 89911c2ef6..e39af70123 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -18,6 +18,7 @@ sm-ssc v1.2 | 201012xx * [WheelNotifyIcon] add BlinkPlayersBest metric. [freem] * [GameCommand] Add GetScreen, GetSteps, GetCourse, GetTrail, and GetCharacter Lua bindings. [freem] +* [StreamDisplay] Remove UseThreePartMethod. 20101218 -------- diff --git a/src/StreamDisplay.cpp b/src/StreamDisplay.cpp index 2828693944..22f5a21c14 100644 --- a/src/StreamDisplay.cpp +++ b/src/StreamDisplay.cpp @@ -33,13 +33,8 @@ void StreamDisplay::Load( const RString &_sMetricsGroup ) float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX"); int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills"); - m_bUsingThreePart = THEME->GetMetricB(sMetricsGroup,"UseThreePartMethod"); m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar"); - // three part method only uses 3 pills - if(iNumPills != 3) - m_bUsingThreePart = false; - FOREACH_ENUM( StreamType, st ) { ASSERT( m_vpSprPill[st].empty() ); @@ -48,35 +43,15 @@ void StreamDisplay::Load( const RString &_sMetricsGroup ) { Sprite *pSpr = new Sprite; - if( m_bUsingThreePart ) - { - pSpr->Load( THEME->GetPathG( sMetricsGroup, ssprintf("%s part%d",StreamTypeToString(st).c_str(),i) ) ); - - if(pSpr->GetNumStates() > 1) - { - pSpr->SetAllStateDelays( THEME->GetMetricF( sMetricsGroup, ssprintf("%spart%ddelay",StreamTypeToString(st).c_str(),i) ) ); - } - } - else - pSpr->Load( THEME->GetPathG( sMetricsGroup, StreamTypeToString(st) ) ); + pSpr->Load( THEME->GetPathG( sMetricsGroup, StreamTypeToString(st) ) ); m_vpSprPill[st].push_back( pSpr ); - if( !m_bUsingThreePart ) - { - m_transformPill.TransformItemDirect( *pSpr, -1, i, iNumPills ); - float f = 1 / fTextureCoordScaleX; - pSpr->SetCustomTextureRect( RectF(f*i,0,f*(i+1),1) ); - } + m_transformPill.TransformItemDirect( *pSpr, -1, i, iNumPills ); + float f = 1 / fTextureCoordScaleX; + pSpr->SetCustomTextureRect( RectF(f*i,0,f*(i+1),1) ); this->AddChild( pSpr ); } - - if( m_bUsingThreePart ) - { - m_fThreePartWidth = THEME->GetMetricF( sMetricsGroup, "ThreePartWidth" ); - // first element positioned depending on metric width specified - m_vpSprPill[st][0]->AddX( -(m_fThreePartWidth/2 + m_vpSprPill[st][0]->GetZoomedWidth()/2) ); - } } } @@ -131,28 +106,9 @@ void StreamDisplay::Update( float fDeltaSecs ) // XXX scale by current song speed - if( !m_bUsingThreePart ) // usual lifebar - { - pSpr->SetCropRight( 1.0f - fPercentFilledThisPill ); - pSpr->SetTexCoordVelocity( -1, 0 ); - } - else // using the three-part method - { + pSpr->SetCropRight( 1.0f - fPercentFilledThisPill ); + pSpr->SetTexCoordVelocity( -1, 0 ); - if( i==1 ) // middle pill - { - float fMiddleWidth = m_fThreePartWidth * m_fTrailingPercent; - pSpr->ZoomToWidth( fMiddleWidth ); - - float fMiddleX = m_vpSprPill[st][0]->GetX() + ( fMiddleWidth/2 ) + ( m_vpSprPill[st][0]->GetZoomedWidth()/2 ); - pSpr->SetX( fMiddleX ); - } - else if( i!=0 ) // last pill - { - float fEndX = m_vpSprPill[st][1]->GetX() + ( m_vpSprPill[st][1]->GetZoomedWidth()/2 ) + ( pSpr->GetZoomedWidth()/2 ); - pSpr->SetX( fEndX ); - } - } // Optimization: Don't draw pills that are covered up switch( st ) { diff --git a/src/StreamDisplay.h b/src/StreamDisplay.h index a9e124de9b..25d624ac58 100644 --- a/src/StreamDisplay.h +++ b/src/StreamDisplay.h @@ -43,8 +43,6 @@ private: float m_fPassingAlpha; float m_fHotAlpha; - bool m_bUsingThreePart; - float m_fThreePartWidth; bool m_bAlwaysBounce; };