diff --git a/stepmania/src/MusicWheelItem.cpp b/stepmania/src/MusicWheelItem.cpp index 227168718a..8d89c7e3d3 100644 --- a/stepmania/src/MusicWheelItem.cpp +++ b/stepmania/src/MusicWheelItem.cpp @@ -269,3 +269,43 @@ void MusicWheelItem::DrawPrimitives() bar->SetGlow( RageColor(0,0,0,0) ); } } + +bool WheelItemData::HasBanner() const +{ + switch( m_Type ) + { + case TYPE_SONG: + return m_pSong->HasBanner(); + case TYPE_COURSE: + return m_pCourse->HasBanner(); + case TYPE_SECTION: + return SONGMAN->GetGroupBannerPath( m_sSectionName ).size() != 0; + /* XXX: These are special cases. */ + case TYPE_ROULETTE: + case TYPE_RANDOM: + return false; + + default: ASSERT(0); return false; // ""; + } +} + +CString WheelItemData::GetBanner() const +{ + switch( m_Type ) + { + case TYPE_SONG: + return m_pSong->GetBannerPath(); + case TYPE_COURSE: + return m_pCourse->m_sBannerPath; + case TYPE_SECTION: + return SONGMAN->GetGroupBannerPath( m_sSectionName ); + + case TYPE_ROULETTE: + return THEME->GetPathToG("Banner random"); + + case TYPE_RANDOM: + return THEME->GetPathToG("Banner roulette"); + + default: ASSERT(0); return ""; + } +} diff --git a/stepmania/src/MusicWheelItem.h b/stepmania/src/MusicWheelItem.h index e46eeac7c2..e52fb368cf 100644 --- a/stepmania/src/MusicWheelItem.h +++ b/stepmania/src/MusicWheelItem.h @@ -59,6 +59,9 @@ struct WheelItemData WheelItemData() {} WheelItemData( WheelItemType wit, Song* pSong, CString sSectionName, Course* pCourse, RageColor color ); + bool HasBanner() const; + CString GetBanner() const; + WheelItemType m_Type; CString m_sSectionName; Course* m_pCourse;