Merge branch 'multimare-grades' into 'next'

Show overall grade emblem requirement of a multi-mare NiGHTS stage in SP pause menu

Closes #71

See merge request STJr/SRB2!1762
This commit is contained in:
sphere 2022-03-21 21:58:54 +00:00
commit 20b73dedfe
3 changed files with 13 additions and 1 deletions

View file

@ -4751,7 +4751,7 @@ static void M_DrawPauseMenu(void)
emblemslot = 2;
break;
case ET_NGRADE:
snprintf(targettext, 9, "%u", P_GetScoreForGrade(gamemap, 0, emblem->var));
snprintf(targettext, 9, "%u", P_GetScoreForGradeOverall(gamemap, emblem->var));
snprintf(currenttext, 9, "%u", G_GetBestNightsScore(gamemap, 0));
targettext[8] = 0;

View file

@ -508,6 +508,17 @@ UINT32 P_GetScoreForGrade(INT16 map, UINT8 mare, UINT8 grade)
return mapheaderinfo[map-1]->grades[mare].grade[grade-1];
}
UINT32 P_GetScoreForGradeOverall(INT16 map, UINT8 grade)
{
UINT8 mares;
INT32 i;
UINT32 score = 0;
mares = mapheaderinfo[map-1]->numGradedMares;
for (i = 0; i < mares; ++i)
score += P_GetScoreForGrade(map, i, grade);
return score;
}
//
// levelflats
//

View file

@ -122,5 +122,6 @@ void P_AddGradesForMare(INT16 i, UINT8 mare, char *gtext);
UINT8 P_GetGrade(UINT32 pscore, INT16 map, UINT8 mare);
UINT8 P_HasGrades(INT16 map, UINT8 mare);
UINT32 P_GetScoreForGrade(INT16 map, UINT8 mare, UINT8 grade);
UINT32 P_GetScoreForGradeOverall(INT16 map, UINT8 grade);
#endif