implement copy ctors
This commit is contained in:
@@ -106,13 +106,54 @@ MusicWheelItem::MusicWheelItem( CString sType ):
|
|||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
{
|
{
|
||||||
m_GradeDisplay[p].Load( THEME->GetPathG(sType,"grades") );
|
m_pGradeDisplay[p] = new GradeDisplay;
|
||||||
m_GradeDisplay[p].SetZoom( 1.0f );
|
m_pGradeDisplay[p]->Load( THEME->GetPathG(sType,"grades") );
|
||||||
m_GradeDisplay[p].SetXY( GRADE_X.GetValue(p), 0 );
|
m_pGradeDisplay[p]->SetZoom( 1.0f );
|
||||||
this->AddChild( &m_GradeDisplay[p] );
|
m_pGradeDisplay[p]->SetXY( GRADE_X.GetValue(p), 0 );
|
||||||
|
this->AddChild( m_pGradeDisplay[p] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MusicWheelItem::MusicWheelItem( const MusicWheelItem &cpy ):
|
||||||
|
WheelItemBase( cpy ),
|
||||||
|
m_sprSongBar( cpy.m_sprSongBar ),
|
||||||
|
m_sprSectionBar( cpy.m_sprSectionBar ),
|
||||||
|
m_sprExpandedBar( cpy.m_sprExpandedBar ),
|
||||||
|
m_sprModeBar( cpy.m_sprModeBar ),
|
||||||
|
m_sprSortBar( cpy.m_sprSortBar ),
|
||||||
|
m_WheelNotifyIcon( cpy.m_WheelNotifyIcon ),
|
||||||
|
m_TextBanner( cpy.m_TextBanner ),
|
||||||
|
m_textSection( cpy.m_textSection ),
|
||||||
|
m_textRoulette( cpy.m_textRoulette ),
|
||||||
|
m_textCourse( cpy.m_textCourse ),
|
||||||
|
m_textSort( cpy.m_textSort )
|
||||||
|
{
|
||||||
|
data = NULL;
|
||||||
|
|
||||||
|
this->AddChild( &m_sprSongBar );
|
||||||
|
this->AddChild( &m_sprSectionBar );
|
||||||
|
this->AddChild( &m_sprExpandedBar );
|
||||||
|
this->AddChild( &m_sprModeBar );
|
||||||
|
this->AddChild( &m_sprSortBar );
|
||||||
|
this->AddChild( &m_WheelNotifyIcon );
|
||||||
|
this->AddChild( &m_TextBanner );
|
||||||
|
this->AddChild( &m_textSection );
|
||||||
|
this->AddChild( &m_textRoulette );
|
||||||
|
this->AddChild( &m_textCourse );
|
||||||
|
this->AddChild( &m_textSort );
|
||||||
|
|
||||||
|
FOREACH_PlayerNumber( p )
|
||||||
|
{
|
||||||
|
m_pGradeDisplay[p] = new GradeDisplay( *cpy.m_pGradeDisplay[p] );
|
||||||
|
this->AddChild( m_pGradeDisplay[p] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MusicWheelItem::~MusicWheelItem()
|
||||||
|
{
|
||||||
|
FOREACH_PlayerNumber( p )
|
||||||
|
delete m_pGradeDisplay[p];
|
||||||
|
}
|
||||||
|
|
||||||
void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded )
|
void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded )
|
||||||
{
|
{
|
||||||
@@ -131,7 +172,7 @@ void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded
|
|||||||
m_textSection.SetHidden( true );
|
m_textSection.SetHidden( true );
|
||||||
m_textRoulette.SetHidden( true );
|
m_textRoulette.SetHidden( true );
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
m_GradeDisplay[p].SetHidden( true );
|
m_pGradeDisplay[p]->SetHidden( true );
|
||||||
m_textCourse.SetHidden( true );
|
m_textCourse.SetHidden( true );
|
||||||
m_textSort.SetHidden( true );
|
m_textSort.SetHidden( true );
|
||||||
|
|
||||||
@@ -245,7 +286,7 @@ void MusicWheelItem::RefreshGrades()
|
|||||||
if( !data->m_pSong || // this isn't a song display
|
if( !data->m_pSong || // this isn't a song display
|
||||||
!GAMESTATE->IsHumanPlayer(p) )
|
!GAMESTATE->IsHumanPlayer(p) )
|
||||||
{
|
{
|
||||||
m_GradeDisplay[p].SetDiffuse( RageColor(1,1,1,0) );
|
m_pGradeDisplay[p]->SetDiffuse( RageColor(1,1,1,0) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +302,7 @@ void MusicWheelItem::RefreshGrades()
|
|||||||
else
|
else
|
||||||
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc, hs );
|
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc, hs );
|
||||||
|
|
||||||
m_GradeDisplay[p].SetGrade( p, hs.GetGrade() );
|
m_pGradeDisplay[p]->SetGrade( p, hs.GetGrade() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ class MusicWheelItem : public WheelItemBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MusicWheelItem(CString sType = "MusicWheelItem");
|
MusicWheelItem(CString sType = "MusicWheelItem");
|
||||||
|
MusicWheelItem( const MusicWheelItem &cpy );
|
||||||
|
virtual ~MusicWheelItem();
|
||||||
|
|
||||||
virtual void LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded );
|
virtual void LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded );
|
||||||
void RefreshGrades();
|
void RefreshGrades();
|
||||||
@@ -38,7 +40,7 @@ public:
|
|||||||
BitmapText m_textRoulette;
|
BitmapText m_textRoulette;
|
||||||
BitmapText m_textCourse;
|
BitmapText m_textCourse;
|
||||||
BitmapText m_textSort;
|
BitmapText m_textSort;
|
||||||
GradeDisplay m_GradeDisplay[NUM_PLAYERS];
|
GradeDisplay *m_pGradeDisplay[NUM_PLAYERS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WheelItemData : public WheelItemBaseData
|
struct WheelItemData : public WheelItemBaseData
|
||||||
|
|||||||
@@ -9,6 +9,22 @@ WheelItemBaseData::WheelItemBaseData( WheelItemType wit, CString sText, RageColo
|
|||||||
m_Flags = WheelNotifyIcon::Flags();
|
m_Flags = WheelNotifyIcon::Flags();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WheelItemBase::WheelItemBase( const WheelItemBase &cpy ):
|
||||||
|
ActorFrame( cpy ),
|
||||||
|
m_sprBar( cpy.m_sprBar ),
|
||||||
|
m_text( cpy.m_text ),
|
||||||
|
m_Type( cpy.m_Type ),
|
||||||
|
m_color( cpy.m_color )
|
||||||
|
{
|
||||||
|
if( cpy.m_pBar == const_cast<Sprite *> (&cpy.m_sprBar) )
|
||||||
|
m_pBar = &m_sprBar;
|
||||||
|
|
||||||
|
if( cpy.GetNumChildren() != 0 )
|
||||||
|
{
|
||||||
|
this->AddChild( &m_sprBar );
|
||||||
|
this->AddChild( &m_text );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WheelItemBase::WheelItemBase(CString sType)
|
WheelItemBase::WheelItemBase(CString sType)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class WheelItemBase : public ActorFrame
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WheelItemBase( CString sType = "WheelItemBase" );
|
WheelItemBase( CString sType = "WheelItemBase" );
|
||||||
|
WheelItemBase( const WheelItemBase &cpy );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void Load( CString sType );
|
void Load( CString sType );
|
||||||
|
|||||||
Reference in New Issue
Block a user