Fix a crash that occured when changing themes that had differing numbers of song/course group colors.
This commit is contained in:
+13
-7
@@ -126,13 +126,6 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld )
|
||||
PREFSMAN->m_bFastLoad.Set( OldVal );
|
||||
|
||||
UpdatePreferredSort();
|
||||
|
||||
// Reload song/course group colors to prevent a crash when switching
|
||||
// themes in-game. (apparently not, though.) -aj
|
||||
NUM_SONG_GROUP_COLORS .Load( "SongManager", "NumSongGroupColors" );
|
||||
SONG_GROUP_COLOR .Load( "SongManager", SONG_GROUP_COLOR_NAME, NUM_SONG_GROUP_COLORS );
|
||||
NUM_COURSE_GROUP_COLORS .Load( "SongManager", "NumCourseGroupColors" );
|
||||
COURSE_GROUP_COLOR .Load( "SongManager", COURSE_GROUP_COLOR_NAME, NUM_COURSE_GROUP_COLORS );
|
||||
}
|
||||
|
||||
void SongManager::InitSongsFromDisk( LoadingWindow *ld )
|
||||
@@ -576,6 +569,19 @@ RageColor SongManager::GetCourseColor( const Course* pCourse ) const
|
||||
}
|
||||
}
|
||||
|
||||
void SongManager::ResetGroupColors()
|
||||
{
|
||||
// Reload song/course group colors to prevent a crash when switching
|
||||
// themes in-game. (apparently not, though.) -aj
|
||||
SONG_GROUP_COLOR.Clear();
|
||||
COURSE_GROUP_COLOR.Clear();
|
||||
|
||||
NUM_SONG_GROUP_COLORS .Load( "SongManager", "NumSongGroupColors" );
|
||||
SONG_GROUP_COLOR .Load( "SongManager", SONG_GROUP_COLOR_NAME, NUM_SONG_GROUP_COLORS );
|
||||
NUM_COURSE_GROUP_COLORS .Load( "SongManager", "NumCourseGroupColors" );
|
||||
COURSE_GROUP_COLOR .Load( "SongManager", COURSE_GROUP_COLOR_NAME, NUM_COURSE_GROUP_COLORS );
|
||||
}
|
||||
|
||||
const vector<Song*> &SongManager::GetSongs( const RString &sGroupName ) const
|
||||
{
|
||||
static const vector<Song*> vEmpty;
|
||||
|
||||
Reference in New Issue
Block a user