[StreamDisplay] Remove UseThreePartMethod
This commit is contained in:
@@ -18,6 +18,7 @@ sm-ssc v1.2 | 201012xx
|
|||||||
* [WheelNotifyIcon] add BlinkPlayersBest metric. [freem]
|
* [WheelNotifyIcon] add BlinkPlayersBest metric. [freem]
|
||||||
* [GameCommand] Add GetScreen, GetSteps, GetCourse, GetTrail, and GetCharacter
|
* [GameCommand] Add GetScreen, GetSteps, GetCourse, GetTrail, and GetCharacter
|
||||||
Lua bindings. [freem]
|
Lua bindings. [freem]
|
||||||
|
* [StreamDisplay] Remove UseThreePartMethod.
|
||||||
|
|
||||||
20101218
|
20101218
|
||||||
--------
|
--------
|
||||||
|
|||||||
+6
-50
@@ -33,13 +33,8 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
|
|||||||
|
|
||||||
float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX");
|
float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX");
|
||||||
int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills");
|
int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills");
|
||||||
m_bUsingThreePart = THEME->GetMetricB(sMetricsGroup,"UseThreePartMethod");
|
|
||||||
m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar");
|
m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar");
|
||||||
|
|
||||||
// three part method only uses 3 pills
|
|
||||||
if(iNumPills != 3)
|
|
||||||
m_bUsingThreePart = false;
|
|
||||||
|
|
||||||
FOREACH_ENUM( StreamType, st )
|
FOREACH_ENUM( StreamType, st )
|
||||||
{
|
{
|
||||||
ASSERT( m_vpSprPill[st].empty() );
|
ASSERT( m_vpSprPill[st].empty() );
|
||||||
@@ -48,35 +43,15 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
|
|||||||
{
|
{
|
||||||
Sprite *pSpr = new Sprite;
|
Sprite *pSpr = new Sprite;
|
||||||
|
|
||||||
if( m_bUsingThreePart )
|
pSpr->Load( THEME->GetPathG( sMetricsGroup, StreamTypeToString(st) ) );
|
||||||
{
|
|
||||||
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) ) );
|
|
||||||
m_vpSprPill[st].push_back( pSpr );
|
m_vpSprPill[st].push_back( pSpr );
|
||||||
|
|
||||||
if( !m_bUsingThreePart )
|
m_transformPill.TransformItemDirect( *pSpr, -1, i, iNumPills );
|
||||||
{
|
float f = 1 / fTextureCoordScaleX;
|
||||||
m_transformPill.TransformItemDirect( *pSpr, -1, i, iNumPills );
|
pSpr->SetCustomTextureRect( RectF(f*i,0,f*(i+1),1) );
|
||||||
float f = 1 / fTextureCoordScaleX;
|
|
||||||
pSpr->SetCustomTextureRect( RectF(f*i,0,f*(i+1),1) );
|
|
||||||
}
|
|
||||||
|
|
||||||
this->AddChild( pSpr );
|
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
|
// XXX scale by current song speed
|
||||||
|
|
||||||
if( !m_bUsingThreePart ) // usual lifebar
|
pSpr->SetCropRight( 1.0f - fPercentFilledThisPill );
|
||||||
{
|
pSpr->SetTexCoordVelocity( -1, 0 );
|
||||||
pSpr->SetCropRight( 1.0f - fPercentFilledThisPill );
|
|
||||||
pSpr->SetTexCoordVelocity( -1, 0 );
|
|
||||||
}
|
|
||||||
else // using the three-part method
|
|
||||||
{
|
|
||||||
|
|
||||||
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
|
// Optimization: Don't draw pills that are covered up
|
||||||
switch( st )
|
switch( st )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ private:
|
|||||||
float m_fPassingAlpha;
|
float m_fPassingAlpha;
|
||||||
float m_fHotAlpha;
|
float m_fHotAlpha;
|
||||||
|
|
||||||
bool m_bUsingThreePart;
|
|
||||||
|
|
||||||
float m_fThreePartWidth;
|
float m_fThreePartWidth;
|
||||||
bool m_bAlwaysBounce;
|
bool m_bAlwaysBounce;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user