Fix crash from MusicWheel when in BuildWheelItemData(), and under case SORT_ENDLESS_COURSES. Automatically generated courses will cause there to be no group name, and the default (preferred) sort. When this function does not return a value, and it gets assigned to c (In MusicWheel), in some cases we will get a crash.

By default, I use white in the metrics, this doesn't look "great," but it should be up to the themer.
This commit is contained in:
Charles Lohr
2006-05-17 06:49:55 +00:00
parent 9787348bb0
commit a84d30b92e
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -4365,6 +4365,7 @@ WriteSimpleValues=1
TapsAndHolds=1
[Course]
SortPreferredColor=1,1,1,1 //Preferred is both for when courses are in preferred sort, or are autogen
SortLevel1Color=1,0,0,1
SortLevel2Color=1,1,0,1
SortLevel3Color=1,0.5,0,1
+3 -1
View File
@@ -51,6 +51,7 @@ XToLocalizedString( SongSort );
/* Maximum lower value of ranges when difficult: */
const int MAX_BOTTOM_RANGE = 10;
#define SORT_PREFERRED_COLOR THEME->GetMetricC("Course","SortPreferredColor")
#define SORT_LEVEL1_COLOR THEME->GetMetricC("Course","SortLevel1Color")
#define SORT_LEVEL2_COLOR THEME->GetMetricC("Course","SortLevel2Color")
#define SORT_LEVEL3_COLOR THEME->GetMetricC("Course","SortLevel3Color")
@@ -729,7 +730,8 @@ RageColor Course::GetColor() const
switch( PREFSMAN->m_CourseSortOrder )
{
case PrefsManager::COURSE_SORT_PREFERRED:
break;
return SORT_PREFERRED_COLOR; //This will also be used for autogen'd courses in some cases.
case PrefsManager::COURSE_SORT_SONGS:
if( m_vEntries.size() >= 7 ) return SORT_LEVEL2_COLOR;
else if( m_vEntries.size() >= 4 ) return SORT_LEVEL4_COLOR;