Set the actor to use for graying, instead of passing it around in an
overloaded "DrawPrimitives". It's too confusing to have different DrawPrimitives overloads.
This commit is contained in:
@@ -223,6 +223,15 @@ void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded
|
|||||||
default: ASSERT(0);
|
default: ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Sprite *pBar = NULL;
|
||||||
|
if( m_sprBar.GetVisible() )
|
||||||
|
pBar = &m_sprBar;
|
||||||
|
else if( m_sprSectionBar.GetVisible() )
|
||||||
|
pBar = &m_sprSectionBar;
|
||||||
|
else
|
||||||
|
pBar = &m_sprExpandedBar;
|
||||||
|
|
||||||
|
SetGrayBar( pBar );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MusicWheelItem::RefreshGrades()
|
void MusicWheelItem::RefreshGrades()
|
||||||
@@ -254,15 +263,7 @@ void MusicWheelItem::RefreshGrades()
|
|||||||
|
|
||||||
void MusicWheelItem::DrawPrimitives()
|
void MusicWheelItem::DrawPrimitives()
|
||||||
{
|
{
|
||||||
Sprite *pBar = NULL;
|
WheelItemBase::DrawPrimitives();
|
||||||
if( m_sprBar.GetVisible() )
|
|
||||||
pBar = &m_sprBar;
|
|
||||||
else if( m_sprSectionBar.GetVisible() )
|
|
||||||
pBar = &m_sprSectionBar;
|
|
||||||
else
|
|
||||||
pBar = &m_sprExpandedBar;
|
|
||||||
|
|
||||||
WheelItemBase::DrawPrimitives( *pBar );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ WheelItemBaseData::WheelItemBaseData( WheelItemType wit, CString sText, RageColo
|
|||||||
WheelItemBase::WheelItemBase(CString sType)
|
WheelItemBase::WheelItemBase(CString sType)
|
||||||
{
|
{
|
||||||
SetName( sType );
|
SetName( sType );
|
||||||
|
m_pBar = NULL;
|
||||||
Load(sType);
|
Load(sType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,6 +43,7 @@ void WheelItemBase::Load( CString sType )
|
|||||||
m_sprBar.Load( THEME->GetPathG(sType,"bar") );
|
m_sprBar.Load( THEME->GetPathG(sType,"bar") );
|
||||||
m_sprBar.SetXY( 0, 0 );
|
m_sprBar.SetXY( 0, 0 );
|
||||||
this->AddChild( &m_sprBar );
|
this->AddChild( &m_sprBar );
|
||||||
|
m_pBar = &m_sprBar;
|
||||||
|
|
||||||
m_text.LoadFromFont( THEME->GetPathF(sType,"text") );
|
m_text.LoadFromFont( THEME->GetPathF(sType,"text") );
|
||||||
m_text.SetShadowLength( 0 );
|
m_text.SetShadowLength( 0 );
|
||||||
@@ -79,7 +81,7 @@ void WheelItemBase::Update( float fDeltaTime )
|
|||||||
Actor::Update( fDeltaTime );
|
Actor::Update( fDeltaTime );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WheelItemBase::DrawGrayBar( Sprite& bar )
|
void WheelItemBase::DrawGrayBar( Actor& bar )
|
||||||
{
|
{
|
||||||
if( m_fPercentGray == 0 )
|
if( m_fPercentGray == 0 )
|
||||||
return;
|
return;
|
||||||
@@ -91,11 +93,12 @@ void WheelItemBase::DrawGrayBar( Sprite& bar )
|
|||||||
bar.SetGlow( RageColor(0,0,0,0) );
|
bar.SetGlow( RageColor(0,0,0,0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WheelItemBase::DrawPrimitives(Sprite& bar)
|
void WheelItemBase::DrawPrimitives()
|
||||||
{
|
{
|
||||||
ActorFrame::DrawPrimitives();
|
ActorFrame::DrawPrimitives();
|
||||||
|
|
||||||
DrawGrayBar( bar );
|
if( m_pBar != NULL )
|
||||||
|
DrawGrayBar( *m_pBar );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -28,20 +28,23 @@ enum WheelItemType
|
|||||||
class WheelItemBase : public ActorFrame
|
class WheelItemBase : public ActorFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WheelItemBase(CString sType = "WheelItemBase");
|
WheelItemBase( CString sType = "WheelItemBase" );
|
||||||
WheelItemBaseData* data;
|
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives(Sprite& bar);
|
virtual void DrawPrimitives();
|
||||||
virtual void DrawPrimitives() { DrawPrimitives( m_sprBar ); }
|
|
||||||
|
|
||||||
void Load( CString sType );
|
void Load( CString sType );
|
||||||
void DrawGrayBar( Sprite& bar );
|
void DrawGrayBar( Actor& bar );
|
||||||
|
|
||||||
virtual void LoadFromWheelItemBaseData( WheelItemBaseData* pWID );
|
virtual void LoadFromWheelItemBaseData( WheelItemBaseData* pWID );
|
||||||
|
|
||||||
float m_fPercentGray;
|
float m_fPercentGray;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void SetGrayBar( Actor *pBar ) { m_pBar = pBar; }
|
||||||
|
|
||||||
|
WheelItemBaseData* data;
|
||||||
|
|
||||||
|
Actor *m_pBar;
|
||||||
Sprite m_sprBar;
|
Sprite m_sprBar;
|
||||||
BitmapText m_text;
|
BitmapText m_text;
|
||||||
WheelItemType m_Type;
|
WheelItemType m_Type;
|
||||||
|
|||||||
Reference in New Issue
Block a user