Fixed Grade display on MusicWheel not corresponding to top score

This commit is contained in:
Chris Danford
2002-10-07 05:45:59 +00:00
parent 1a40998fb3
commit f4ef92ab81
3 changed files with 28 additions and 11 deletions
+11 -4
View File
@@ -185,10 +185,17 @@ void WheelItemDisplay::RefreshGrades()
if( m_pSong ) // this is a song display if( m_pSong ) // this is a song display
{ {
const Difficulty dc = GAMESTATE->m_PreferredDifficulty[p]; if( m_pSong == GAMESTATE->m_pCurSong )
const Grade grade = m_pSong->GetGradeForDifficulty( GAMESTATE->GetCurrentStyleDef(), p, dc ); {
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade ); Notes* pNotes = GAMESTATE->m_pCurNotes[p];
//m_GradeDisplay[p].SetDiffuse( PlayerToColor((PlayerNumber)p) ); m_GradeDisplay[p].SetGrade( (PlayerNumber)p, pNotes->m_TopGrade );
}
else
{
const Difficulty dc = GAMESTATE->m_PreferredDifficulty[p];
const Grade grade = m_pSong->GetGradeForDifficulty( GAMESTATE->GetCurrentStyleDef(), p, dc );
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade );
}
} }
else // this is a section display else // this is a section display
{ {
+12 -5
View File
@@ -187,12 +187,19 @@ bool NotesWriterDWI::WriteDWINotesTag( FILE* fp, const Notes &out )
default: return false; // not a type supported by DWI default: return false; // not a type supported by DWI
} }
switch( out.m_Difficulty ) if( 0==out.m_sDescription.CompareNoCase("challenge") )
fprintf( fp, "SMANIAC:" );
else if( 0==out.m_sDescription.CompareNoCase("smaniac") )
fprintf( fp, "SMANIAC:" );
else
{ {
case DIFFICULTY_EASY: fprintf( fp, "BASIC:" ); break; switch( out.m_Difficulty )
case DIFFICULTY_MEDIUM: fprintf( fp, "ANOTHER:" ); break; {
case DIFFICULTY_HARD: fprintf( fp, "MANIAC:" ); break; case DIFFICULTY_EASY: fprintf( fp, "BASIC:" ); break;
default: ASSERT(0); return false; case DIFFICULTY_MEDIUM: fprintf( fp, "ANOTHER:" ); break;
case DIFFICULTY_HARD: fprintf( fp, "MANIAC:" ); break;
default: ASSERT(0); return false;
}
} }
fprintf( fp, "%d:\n", out.m_iMeter ); fprintf( fp, "%d:\n", out.m_iMeter );
+5 -2
View File
@@ -799,17 +799,20 @@ void Song::AddAutoGenNotes()
Grade Song::GetGradeForDifficulty( const StyleDef *st, int p, Difficulty dc ) const Grade Song::GetGradeForDifficulty( const StyleDef *st, int p, Difficulty dc ) const
{ {
// return max grade of notes in difficulty class
CArray<Notes*, Notes*> aNotes; CArray<Notes*, Notes*> aNotes;
this->GetNotesThatMatch( st, p, aNotes ); this->GetNotesThatMatch( st, p, aNotes );
SortNotesArrayByDifficulty( aNotes ); SortNotesArrayByDifficulty( aNotes );
Grade grade = GRADE_NO_DATA;
for( int i=0; i<aNotes.GetSize(); i++ ) for( int i=0; i<aNotes.GetSize(); i++ )
{ {
const Notes* pNotes = aNotes[i]; const Notes* pNotes = aNotes[i];
if( pNotes->m_Difficulty == dc ) if( pNotes->m_Difficulty == dc )
return pNotes->m_TopGrade; grade = max( grade, pNotes->m_TopGrade );
} }
return GRADE_NO_DATA; return grade;
} }