fix crash, cleanup
This commit is contained in:
@@ -31,7 +31,7 @@ void MeterDisplay::Load( RString sStreamPath, float fStreamWidth, RString sTipPa
|
|||||||
|
|
||||||
void MeterDisplay::LoadFromNode( const XNode* pNode )
|
void MeterDisplay::LoadFromNode( const XNode* pNode )
|
||||||
{
|
{
|
||||||
LOG->Trace( "MeterDisplay::LoadFromNode(%s,node)", ActorUtil::GetWhere(pNode).c_str() );
|
LOG->Trace( "MeterDisplay::LoadFromNode(%s)", ActorUtil::GetWhere(pNode).c_str() );
|
||||||
|
|
||||||
if( !pNode->GetAttrValue("StreamWidth", m_fStreamWidth) )
|
if( !pNode->GetAttrValue("StreamWidth", m_fStreamWidth) )
|
||||||
RageException::Throw( "%s: MeterDisplay: missing the \"StreamWidth\" attribute", ActorUtil::GetWhere(pNode).c_str() );
|
RageException::Throw( "%s: MeterDisplay: missing the \"StreamWidth\" attribute", ActorUtil::GetWhere(pNode).c_str() );
|
||||||
@@ -64,6 +64,7 @@ void MeterDisplay::SetPercent( float fPercent )
|
|||||||
|
|
||||||
m_sprStream->SetCropRight( 1-fPercent );
|
m_sprStream->SetCropRight( 1-fPercent );
|
||||||
|
|
||||||
|
if( m_sprTip.IsLoaded() )
|
||||||
m_sprTip->SetX( SCALE(fPercent, 0.f, 1.f, -m_fStreamWidth/2, m_fStreamWidth/2) );
|
m_sprTip->SetX( SCALE(fPercent, 0.f, 1.f, -m_fStreamWidth/2, m_fStreamWidth/2) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user