2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-06-23 02:50:33 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: NoteDataWithScoring
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "NoteDataWithScoring.h"
|
|
|
|
|
|
|
|
|
|
NoteDataWithScoring::NoteDataWithScoring()
|
|
|
|
|
{
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-18 22:24:34 +00:00
|
|
|
void NoteDataWithScoring::Init()
|
2002-08-01 21:55:40 +00:00
|
|
|
{
|
|
|
|
|
NoteData::Init();
|
|
|
|
|
|
2002-06-23 02:50:33 +00:00
|
|
|
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
2002-12-17 23:31:35 +00:00
|
|
|
m_TapNoteScores[t].clear();
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2002-11-03 21:38:22 +00:00
|
|
|
m_HoldNoteScores.clear();
|
|
|
|
|
m_fHoldNoteLife.clear();
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2003-07-24 13:35:20 +00:00
|
|
|
int NoteDataWithScoring::GetMaxCombo() const
|
|
|
|
|
{
|
|
|
|
|
int iNumSuccessfulTapNotes = 0;
|
|
|
|
|
int fEndBeat = GetMaxBeat()+1;
|
|
|
|
|
|
|
|
|
|
unsigned iStartIndex = BeatToNoteRow( (float)0 );
|
|
|
|
|
unsigned iEndIndex = BeatToNoteRow( fEndBeat );
|
|
|
|
|
|
|
|
|
|
int combo = 0;
|
|
|
|
|
int maxcombo = 0;
|
|
|
|
|
|
|
|
|
|
for( unsigned i=iStartIndex; i<min(float(iEndIndex), float(m_TapNoteScores[0].size())); i++ )
|
|
|
|
|
{
|
|
|
|
|
for( int t=0; t<GetNumTracks(); t++ )
|
|
|
|
|
{
|
|
|
|
|
if( this->GetTapNote(t, i) != TAP_EMPTY )
|
|
|
|
|
if (GetTapNoteScore(t, i) >= TNS_GREAT)
|
|
|
|
|
combo++;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (combo > maxcombo) maxcombo = combo;
|
|
|
|
|
combo = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return max(combo, maxcombo);
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
int iNumSuccessfulTapNotes = 0;
|
|
|
|
|
|
2003-03-06 22:25:21 +00:00
|
|
|
if(fEndBeat == -1)
|
|
|
|
|
fEndBeat = GetMaxBeat()+1;
|
|
|
|
|
|
2002-12-17 23:31:35 +00:00
|
|
|
unsigned iStartIndex = BeatToNoteRow( fStartBeat );
|
|
|
|
|
unsigned iEndIndex = BeatToNoteRow( fEndBeat );
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2003-04-20 22:08:32 +00:00
|
|
|
for( unsigned i=iStartIndex; i<min(float(iEndIndex), float(m_TapNoteScores[0].size())); i++ )
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2003-02-01 05:16:38 +00:00
|
|
|
for( int t=0; t<GetNumTracks(); t++ )
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2002-12-17 22:07:59 +00:00
|
|
|
if( this->GetTapNote(t, i) != TAP_EMPTY && GetTapNoteScore(t, i) == tns )
|
2002-06-23 02:50:33 +00:00
|
|
|
iNumSuccessfulTapNotes++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return iNumSuccessfulTapNotes;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
int NoteDataWithScoring::GetNumDoublesWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
int iNumSuccessfulDoubles = 0;
|
|
|
|
|
|
2003-03-06 22:25:21 +00:00
|
|
|
if(fEndBeat == -1)
|
|
|
|
|
fEndBeat = GetMaxBeat()+1;
|
|
|
|
|
|
2002-12-17 23:31:35 +00:00
|
|
|
unsigned iStartIndex = BeatToNoteRow( fStartBeat );
|
|
|
|
|
unsigned iEndIndex = BeatToNoteRow( fEndBeat );
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2003-04-20 12:56:01 +00:00
|
|
|
for( unsigned i=iStartIndex; i<min(static_cast<float>(iEndIndex), static_cast<float>(m_TapNoteScores[0].size())); i++ )
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
int iNumNotesThisIndex = 0;
|
2003-01-11 08:55:21 +00:00
|
|
|
TapNoteScore minTapNoteScore = TNS_MARVELOUS;
|
2003-02-01 05:16:38 +00:00
|
|
|
for( int t=0; t<GetNumTracks(); t++ )
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2002-10-25 04:37:00 +00:00
|
|
|
if( GetTapNote(t, i) != TAP_EMPTY )
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
iNumNotesThisIndex++;
|
2002-12-17 22:07:59 +00:00
|
|
|
minTapNoteScore = min( minTapNoteScore, GetTapNoteScore(t, i) );
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2002-09-12 02:31:52 +00:00
|
|
|
if( iNumNotesThisIndex >= 2 && minTapNoteScore == tns )
|
2002-06-23 02:50:33 +00:00
|
|
|
iNumSuccessfulDoubles++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return iNumSuccessfulDoubles;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
int NoteDataWithScoring::GetNumHoldNotesWithScore( HoldNoteScore hns, const float fStartBeat, float fEndBeat ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
int iNumSuccessfulHolds = 0;
|
|
|
|
|
|
2003-03-06 22:25:21 +00:00
|
|
|
if(fEndBeat == -1)
|
|
|
|
|
fEndBeat = GetMaxBeat()+1;
|
|
|
|
|
|
2002-11-02 22:59:12 +00:00
|
|
|
for( int i=0; i<GetNumHoldNotes(); i++ )
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2002-11-02 22:46:15 +00:00
|
|
|
const HoldNote &hn = GetHoldNote(i);
|
2003-02-16 20:27:53 +00:00
|
|
|
if( fStartBeat <= hn.fStartBeat && hn.fEndBeat <= fEndBeat && m_HoldNoteScores[i] == hns )
|
2002-06-23 02:50:33 +00:00
|
|
|
iNumSuccessfulHolds++;
|
|
|
|
|
}
|
|
|
|
|
return iNumSuccessfulHolds;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-26 19:34:59 +00:00
|
|
|
/* 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. */
|
|
|
|
|
TapNoteScore NoteDataWithScoring::MinTapNoteScore(unsigned row) const
|
2002-12-17 22:05:17 +00:00
|
|
|
{
|
2003-03-26 19:34:59 +00:00
|
|
|
TapNoteScore score = TNS_MARVELOUS;
|
2003-02-01 05:16:38 +00:00
|
|
|
for( int t=0; t<GetNumTracks(); t++ )
|
2003-03-26 19:34:59 +00:00
|
|
|
{
|
2003-04-10 05:46:31 +00:00
|
|
|
/* If there's no tap note on this row, skip it, or else the score will always be TNS_NONE. */
|
|
|
|
|
if(GetTapNote(t, row) == TAP_EMPTY)
|
|
|
|
|
continue;
|
2003-03-26 19:34:59 +00:00
|
|
|
score = min( score, GetTapNoteScore(t, row) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return score;
|
2002-12-17 22:05:17 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-10 05:46:31 +00:00
|
|
|
bool NoteDataWithScoring::IsRowCompletelyJudged(unsigned row) const
|
|
|
|
|
{
|
|
|
|
|
return MinTapNoteScore(row) >= TNS_MISS;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-26 19:34:59 +00:00
|
|
|
/* Return the last tap score of a row: the grade of the tap that completed
|
2003-03-27 18:40:58 +00:00
|
|
|
* 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. */
|
2003-03-27 00:39:17 +00:00
|
|
|
int NoteDataWithScoring::LastTapNoteScoreTrack(unsigned row) const
|
2003-03-26 19:34:59 +00:00
|
|
|
{
|
|
|
|
|
float scoretime = -9999;
|
2003-03-27 00:39:17 +00:00
|
|
|
int best_track = -1;
|
2003-03-26 19:34:59 +00:00
|
|
|
for( int t=0; t<GetNumTracks(); t++ )
|
|
|
|
|
{
|
|
|
|
|
/* If there's no tap note on this row, skip it; the score will always be TNS_NONE. */
|
|
|
|
|
if(GetTapNote(t, row) == TAP_EMPTY) continue;
|
|
|
|
|
|
2003-03-26 22:22:44 +00:00
|
|
|
TapNoteScore tns = GetTapNoteScore(t, row);
|
2003-03-27 18:40:58 +00:00
|
|
|
if(tns == TNS_NONE || tns == TNS_MISS) return t;
|
2003-03-26 22:22:44 +00:00
|
|
|
|
2003-03-26 19:34:59 +00:00
|
|
|
float tm = GetTapNoteOffset(t, row);
|
|
|
|
|
if(tm < scoretime) continue;
|
|
|
|
|
|
|
|
|
|
scoretime = tm;
|
2003-03-27 00:39:17 +00:00
|
|
|
best_track = t;
|
2003-03-26 19:34:59 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-27 00:39:17 +00:00
|
|
|
return best_track;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TapNoteScore NoteDataWithScoring::LastTapNoteScore(unsigned row) const
|
|
|
|
|
{
|
|
|
|
|
int track = LastTapNoteScoreTrack(row);
|
|
|
|
|
if(track == -1) return TNS_NONE;
|
|
|
|
|
return GetTapNoteScore(track, row);
|
2003-03-26 19:34:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
float NoteDataWithScoring::GetActualRadarValue( RadarCategory rv, float fSongSeconds ) const
|
2002-12-17 22:05:17 +00:00
|
|
|
{
|
|
|
|
|
switch( rv )
|
|
|
|
|
{
|
|
|
|
|
case RADAR_STREAM: return GetActualStreamRadarValue( fSongSeconds ); break;
|
|
|
|
|
case RADAR_VOLTAGE: return GetActualVoltageRadarValue( fSongSeconds ); break;
|
|
|
|
|
case RADAR_AIR: return GetActualAirRadarValue( fSongSeconds ); break;
|
|
|
|
|
case RADAR_FREEZE: return GetActualFreezeRadarValue( fSongSeconds ); break;
|
|
|
|
|
case RADAR_CHAOS: return GetActualChaosRadarValue( fSongSeconds ); break;
|
|
|
|
|
default: ASSERT(0); return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
float NoteDataWithScoring::GetActualStreamRadarValue( float fSongSeconds ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2003-07-24 13:35:20 +00:00
|
|
|
/* // density of steps
|
2002-09-12 02:31:52 +00:00
|
|
|
int iNumSuccessfulNotes =
|
2003-01-11 08:55:21 +00:00
|
|
|
GetNumTapNotesWithScore(TNS_MARVELOUS) +
|
2002-09-12 02:31:52 +00:00
|
|
|
GetNumTapNotesWithScore(TNS_PERFECT) +
|
|
|
|
|
GetNumTapNotesWithScore(TNS_GREAT)/2 +
|
|
|
|
|
GetNumHoldNotesWithScore(HNS_OK);
|
2002-06-23 02:50:33 +00:00
|
|
|
float fNotesPerSecond = iNumSuccessfulNotes/fSongSeconds;
|
2002-07-03 21:27:26 +00:00
|
|
|
float fReturn = fNotesPerSecond / 7;
|
2002-07-03 03:13:13 +00:00
|
|
|
return min( fReturn, 1.0f );
|
2003-07-24 13:35:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
int MaxCombo = GetMaxCombo();
|
|
|
|
|
float TotalSteps = GetNumTapNotes();
|
|
|
|
|
|
|
|
|
|
return min( (float)MaxCombo/TotalSteps, 1.0f);
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
float NoteDataWithScoring::GetActualVoltageRadarValue( float fSongSeconds ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2003-07-24 13:35:20 +00:00
|
|
|
// voltage is essentialy perfects divided by # of steps
|
|
|
|
|
float totalnotes = GetNumTapNotes();
|
|
|
|
|
float perfects = GetNumTapNotesWithScore(TNS_PERFECT) + GetNumTapNotesWithScore(TNS_MARVELOUS);
|
|
|
|
|
|
|
|
|
|
float result = perfects/totalnotes;
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
/* float fAvgBPS = GetLastBeat() / fSongSeconds;
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2002-07-03 21:27:26 +00:00
|
|
|
// peak density of steps
|
|
|
|
|
float fMaxDensitySoFar = 0;
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2002-07-03 21:27:26 +00:00
|
|
|
const int BEAT_WINDOW = 8;
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2003-03-06 22:40:04 +00:00
|
|
|
const int fEndBeat = (int) GetMaxBeat()+1;
|
|
|
|
|
|
|
|
|
|
for( int i=0; i<fEndBeat; i+=BEAT_WINDOW )
|
2002-07-03 21:27:26 +00:00
|
|
|
{
|
2003-01-11 08:55:21 +00:00
|
|
|
int iNumNotesThisWindow = 0;
|
|
|
|
|
iNumNotesThisWindow += GetNumTapNotesWithScore(TNS_MARVELOUS,(float)i,(float)i+BEAT_WINDOW);
|
|
|
|
|
iNumNotesThisWindow += GetNumTapNotesWithScore(TNS_PERFECT,(float)i,(float)i+BEAT_WINDOW);
|
|
|
|
|
iNumNotesThisWindow += GetNumHoldNotesWithScore(HNS_OK,(float)i,(float)i+BEAT_WINDOW);
|
2002-07-03 21:27:26 +00:00
|
|
|
float fDensityThisWindow = iNumNotesThisWindow/(float)BEAT_WINDOW;
|
|
|
|
|
fMaxDensitySoFar = max( fMaxDensitySoFar, fDensityThisWindow );
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2002-07-03 21:27:26 +00:00
|
|
|
float fReturn = fMaxDensitySoFar*fAvgBPS/10;
|
2002-07-03 03:13:13 +00:00
|
|
|
return min( fReturn, 1.0f );
|
2003-07-24 13:35:20 +00:00
|
|
|
*/
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
float NoteDataWithScoring::GetActualAirRadarValue( float fSongSeconds ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
// number of doubles
|
2002-09-12 02:31:52 +00:00
|
|
|
int iNumDoubles =
|
2003-01-11 08:55:21 +00:00
|
|
|
GetNumDoublesWithScore(TNS_MARVELOUS) +
|
2002-09-12 02:31:52 +00:00
|
|
|
GetNumDoublesWithScore(TNS_PERFECT) +
|
|
|
|
|
GetNumDoublesWithScore(TNS_GREAT)/2;
|
2003-07-24 13:35:20 +00:00
|
|
|
// float fReturn = iNumDoubles / fSongSeconds;
|
|
|
|
|
int iTotalDoubles = GetNumDoubles();
|
|
|
|
|
|
|
|
|
|
if (iTotalDoubles == 0) return 1.0f; // no jumps in song
|
|
|
|
|
float fReturn = (float)iNumDoubles / iTotalDoubles;
|
2002-07-03 03:13:13 +00:00
|
|
|
return min( fReturn, 1.0f );
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
float NoteDataWithScoring::GetActualChaosRadarValue( float fSongSeconds ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2003-07-24 13:35:20 +00:00
|
|
|
/* // count number of triplets
|
2002-07-03 21:27:26 +00:00
|
|
|
int iNumChaosNotesCompleted = 0;
|
2002-12-17 23:31:35 +00:00
|
|
|
for( unsigned r=0; r<m_TapNoteScores[0].size(); r++ )
|
2002-07-03 03:13:13 +00:00
|
|
|
{
|
2003-03-26 19:34:59 +00:00
|
|
|
if( !IsRowEmpty(r) && MinTapNoteScore(r) >= TNS_GREAT && GetNoteType(r) >= NOTE_TYPE_12TH )
|
2002-07-31 19:40:40 +00:00
|
|
|
iNumChaosNotesCompleted++;
|
2002-07-03 03:13:13 +00:00
|
|
|
}
|
|
|
|
|
|
2002-07-11 19:02:26 +00:00
|
|
|
float fReturn = iNumChaosNotesCompleted / fSongSeconds * 0.5f;
|
2002-07-03 03:13:13 +00:00
|
|
|
return min( fReturn, 1.0f );
|
2003-07-24 13:35:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
float marvelous = GetNumTapNotesWithScore(TNS_MARVELOUS);
|
|
|
|
|
float perfect = GetNumTapNotesWithScore(TNS_PERFECT);
|
|
|
|
|
float great = GetNumTapNotesWithScore(TNS_GREAT);
|
|
|
|
|
float good = GetNumTapNotesWithScore(TNS_GOOD);
|
|
|
|
|
float boo = GetNumTapNotesWithScore(TNS_BOO);
|
|
|
|
|
float miss = GetNumTapNotesWithScore(TNS_MISS);
|
|
|
|
|
|
|
|
|
|
float ok = GetNumHoldNotesWithScore(HNS_OK);
|
|
|
|
|
float holdnotes = GetNumHoldNotes();
|
|
|
|
|
|
|
|
|
|
float DPEarned = 2 * (marvelous + perfect)
|
|
|
|
|
+ (great)
|
|
|
|
|
- 4 * (boo)
|
|
|
|
|
- 8 * (miss)
|
|
|
|
|
+ 6 * (ok);
|
|
|
|
|
|
|
|
|
|
float TotalDP = 2 * (marvelous + perfect + great
|
|
|
|
|
+ good + boo + miss)
|
|
|
|
|
+ 6 * holdnotes;
|
|
|
|
|
|
|
|
|
|
float fResult = DPEarned/TotalDP;
|
|
|
|
|
|
|
|
|
|
return min( fResult, 1.0f);
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-26 17:53:31 +00:00
|
|
|
float NoteDataWithScoring::GetActualFreezeRadarValue( float fSongSeconds ) const
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
|
|
|
|
// number of hold steps
|
2003-07-24 13:35:20 +00:00
|
|
|
float totalsteps = (float)GetNumHoldNotes();
|
|
|
|
|
if (totalsteps == 0) return 1.0f;
|
|
|
|
|
float fReturn = GetNumHoldNotesWithScore(HNS_OK) / totalsteps;
|
2002-07-03 03:13:13 +00:00
|
|
|
return min( fReturn, 1.0f );
|
2002-06-23 02:50:33 +00:00
|
|
|
}
|
2002-12-18 22:24:34 +00:00
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
|
void extend(vector<T> &v, T val, unsigned pos)
|
|
|
|
|
{
|
|
|
|
|
int needed = pos - v.size() + 1;
|
|
|
|
|
if(needed > 0)
|
|
|
|
|
{
|
|
|
|
|
needed += 100; /* optimization: give it a little more than it needs */
|
|
|
|
|
v.insert(v.end(), needed, val);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TapNoteScore NoteDataWithScoring::GetTapNoteScore(unsigned track, unsigned row) const
|
|
|
|
|
{
|
|
|
|
|
if(row >= m_TapNoteScores[track].size())
|
|
|
|
|
return TNS_NONE;
|
|
|
|
|
return m_TapNoteScores[track][row];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NoteDataWithScoring::SetTapNoteScore(unsigned track, unsigned row, TapNoteScore tns)
|
|
|
|
|
{
|
|
|
|
|
extend(m_TapNoteScores[track], TNS_NONE, row);
|
|
|
|
|
m_TapNoteScores[track][row] = tns;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-26 19:34:59 +00:00
|
|
|
float NoteDataWithScoring::GetTapNoteOffset(unsigned track, unsigned row) const
|
|
|
|
|
{
|
|
|
|
|
if(row >= m_TapNoteOffset[track].size())
|
|
|
|
|
return 0;
|
|
|
|
|
return m_TapNoteOffset[track][row];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NoteDataWithScoring::SetTapNoteOffset(unsigned track, unsigned row, float offset)
|
|
|
|
|
{
|
|
|
|
|
extend(m_TapNoteOffset[track], 0.f, row);
|
|
|
|
|
m_TapNoteOffset[track][row] = offset;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-18 22:24:34 +00:00
|
|
|
HoldNoteScore NoteDataWithScoring::GetHoldNoteScore(unsigned h) const
|
|
|
|
|
{
|
|
|
|
|
if(h >= m_HoldNoteScores.size())
|
|
|
|
|
return HNS_NONE;
|
|
|
|
|
return m_HoldNoteScores[h];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NoteDataWithScoring::SetHoldNoteScore(unsigned h, HoldNoteScore hns)
|
|
|
|
|
{
|
|
|
|
|
extend(m_HoldNoteScores, HNS_NONE, h);
|
|
|
|
|
m_HoldNoteScores[h] = hns;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NoteDataWithScoring::SetHoldNoteLife(unsigned h, float f)
|
|
|
|
|
{
|
|
|
|
|
extend(m_fHoldNoteLife, 1.0f, h);
|
|
|
|
|
m_fHoldNoteLife[h] = f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float NoteDataWithScoring::GetHoldNoteLife(unsigned h) const
|
|
|
|
|
{
|
|
|
|
|
// start with full life
|
|
|
|
|
if(h >= m_fHoldNoteLife.size())
|
|
|
|
|
return 1.0f;
|
|
|
|
|
return m_fHoldNoteLife[h];
|
|
|
|
|
}
|