Use generic names for TapNoteScore values since they are treated genericly by the code.
Theme changes coming...
This commit is contained in:
@@ -72,7 +72,7 @@ int GetSuccessfulMines( const NoteData &in, int iStartIndex = 0, int iEndIndex =
|
||||
for( int t=0; t<in.GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = in.GetTapNote(t,i);
|
||||
if( tn.type == TapNote::mine && tn.result.tns == TNS_AVOIDED_MINE )
|
||||
if( tn.type == TapNote::mine && tn.result.tns == TNS_AvoidMine )
|
||||
iNumSuccessfulMinesNotes++;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
|
||||
continue;
|
||||
if( tn.type == TapNote::mine ) // mines don't count
|
||||
continue;
|
||||
if( tn.result.tns <= TNS_BOO )
|
||||
if( tn.result.tns <= TNS_Tier5 )
|
||||
Missed = true;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
|
||||
|
||||
/* Return the last tap score of a row: the grade of the tap that completed
|
||||
* the row. If the row has no tap notes, return -1. If any tap notes aren't
|
||||
* graded (any tap is TNS_NONE) or are missed (TNS_MISS), return it. */
|
||||
* graded (any tap is TNS_None) or are missed (TNS_Miss), return it. */
|
||||
int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow )
|
||||
{
|
||||
float scoretime = -9999;
|
||||
@@ -144,7 +144,7 @@ int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow )
|
||||
|
||||
TapNoteScore tns = tn.result.tns;
|
||||
|
||||
if( tns == TNS_MISS || tns == TNS_NONE )
|
||||
if( tns == TNS_Miss || tns == TNS_None )
|
||||
return t;
|
||||
|
||||
float tm = tn.result.fTapNoteOffset;
|
||||
@@ -169,13 +169,13 @@ TapNoteResult NoteDataWithScoring::LastTapNoteResult( const NoteData &in, unsign
|
||||
|
||||
|
||||
/* Return the minimum tap score of a row. If the row isn't complete (not all
|
||||
* taps have been hit), return TNS_NONE or TNS_MISS. */
|
||||
* taps have been hit), return TNS_None or TNS_Miss. */
|
||||
TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned row )
|
||||
{
|
||||
TapNoteScore score = TNS_MARVELOUS;
|
||||
TapNoteScore score = TNS_Tier1;
|
||||
for( int t=0; t<in.GetNumTracks(); t++ )
|
||||
{
|
||||
/* Ignore mines, or the score will always be TNS_NONE. */
|
||||
/* Ignore mines, or the score will always be TNS_None. */
|
||||
const TapNote &tn = in.GetTapNote(t, row);
|
||||
if( tn.type == TapNote::empty || tn.type == TapNote::mine )
|
||||
continue;
|
||||
@@ -187,20 +187,20 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned
|
||||
|
||||
bool NoteDataWithScoring::IsRowCompletelyJudged( const NoteData &in, unsigned row )
|
||||
{
|
||||
return MinTapNoteScore( in, row ) >= TNS_MISS;
|
||||
return MinTapNoteScore( in, row ) >= TNS_Miss;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
/* Return the ratio of actual to possible Perfects. */
|
||||
/* Return the ratio of actual to possible Tier2s. */
|
||||
float GetActualStreamRadarValue( const NoteData &in, float fSongSeconds, PlayerNumber pn )
|
||||
{
|
||||
int iTotalSteps = in.GetNumTapNotes();
|
||||
if( iTotalSteps == 0 )
|
||||
return 1.0f;
|
||||
|
||||
const int Perfects = GetNumTapNotesWithScore( in, TNS_PERFECT );
|
||||
return clamp( float(Perfects)/iTotalSteps, 0.0f, 1.0f );
|
||||
const int Tier2s = GetNumTapNotesWithScore( in, TNS_Tier2 );
|
||||
return clamp( float(Tier2s)/iTotalSteps, 0.0f, 1.0f );
|
||||
}
|
||||
|
||||
/* Return the ratio of actual combo to max combo. */
|
||||
@@ -215,7 +215,7 @@ float GetActualVoltageRadarValue( const NoteData &in, float fSongSeconds, Player
|
||||
return clamp( fComboPercent, 0.0f, 1.0f );
|
||||
}
|
||||
|
||||
/* Return the ratio of actual to possible Perfects on jumps. */
|
||||
/* Return the ratio of actual to possible Tier2s on jumps. */
|
||||
float GetActualAirRadarValue( const NoteData &in, float fSongSeconds, PlayerNumber pn )
|
||||
{
|
||||
const int iTotalDoubles = in.GetNumJumps();
|
||||
@@ -223,7 +223,7 @@ float GetActualAirRadarValue( const NoteData &in, float fSongSeconds, PlayerNumb
|
||||
return 1.0f; // no jumps in song
|
||||
|
||||
// number of doubles
|
||||
const int iNumDoubles = GetNumNWithScore( in, TNS_PERFECT, 2 );
|
||||
const int iNumDoubles = GetNumNWithScore( in, TNS_Tier2, 2 );
|
||||
return clamp( (float)iNumDoubles / iTotalDoubles, 0.0f, 1.0f );
|
||||
}
|
||||
|
||||
@@ -247,8 +247,8 @@ float GetActualFreezeRadarValue( const NoteData &in, float fSongSeconds, PlayerN
|
||||
return 1.0f;
|
||||
|
||||
const int ActualHolds =
|
||||
GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_OK ) +
|
||||
GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_OK );
|
||||
GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_Held ) +
|
||||
GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_Held );
|
||||
return clamp( float(ActualHolds) / iTotalHolds, 0.0f, 1.0f );
|
||||
}
|
||||
|
||||
@@ -268,12 +268,12 @@ void NoteDataWithScoring::GetActualRadarValues( const NoteData &in, PlayerNumber
|
||||
case RADAR_AIR: out[rc] = GetActualAirRadarValue( in, fSongSeconds, pn ); break;
|
||||
case RADAR_FREEZE: out[rc] = GetActualFreezeRadarValue( in, fSongSeconds, pn ); break;
|
||||
case RADAR_CHAOS: out[rc] = GetActualChaosRadarValue( in, fSongSeconds, pn ); break;
|
||||
case RADAR_NUM_TAPS_AND_HOLDS: out[rc] = (float) GetNumNWithScore( in, TNS_GOOD, 1 ); break;
|
||||
case RADAR_NUM_JUMPS: out[rc] = (float) GetNumNWithScore( in, TNS_GOOD, 2 ); break;
|
||||
case RADAR_NUM_HOLDS: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_OK ); break;
|
||||
case RADAR_NUM_TAPS_AND_HOLDS: out[rc] = (float) GetNumNWithScore( in, TNS_Tier4, 1 ); break;
|
||||
case RADAR_NUM_JUMPS: out[rc] = (float) GetNumNWithScore( in, TNS_Tier4, 2 ); break;
|
||||
case RADAR_NUM_HOLDS: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_Held ); break;
|
||||
case RADAR_NUM_MINES: out[rc] = (float) GetSuccessfulMines( in ); break;
|
||||
case RADAR_NUM_HANDS: out[rc] = (float) GetSuccessfulHands( in ); break;
|
||||
case RADAR_NUM_ROLLS: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_OK ); break;
|
||||
case RADAR_NUM_ROLLS: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_Held ); break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user