Implement RADAR_NUM_HANDS result.

Change hold note contents to rows (from beats).  This makes it
consistent with tap note data.  Row numbers are also generally
more precise, since they're integers, not floats.
This commit is contained in:
Glenn Maynard
2003-12-16 04:00:39 +00:00
parent ad3057baea
commit 7003e2b157
10 changed files with 158 additions and 113 deletions
+25 -11
View File
@@ -132,17 +132,6 @@ NoteType BeatToNoteType( float fBeat );
bool IsNoteOfType( int iNoteIndex, NoteType t );
CString NoteTypeToString( NoteType nt );
struct HoldNote
{
HoldNote( int t, float s, float e ) { iTrack=t; fStartBeat=s; fEndBeat=e; }
int iTrack;
float fStartBeat;
float fEndBeat;
};
inline int BeatToNoteRow( float fBeatNum ) { return int( fBeatNum * ROWS_PER_BEAT + 0.5f); }; // round
inline int BeatToNoteRowNotRounded( float fBeatNum ) { return (int)( fBeatNum * ROWS_PER_BEAT ); };
inline float NoteRowToBeat( float fNoteIndex ) { return fNoteIndex / (float)ROWS_PER_BEAT; };
@@ -150,5 +139,30 @@ inline float NoteRowToBeat( int iNoteIndex ) { return NoteRowToBeat( (float)iN
struct HoldNote
{
HoldNote( int t, int s, int e ) { iTrack=t; iStartRow=s; iEndRow=e; }
bool RowIsInRange( int row ) const { return iStartRow <= row && row <= iEndRow; }
bool RangeOverlaps( int start, int end ) const
{
return
( iStartRow >= start && end >= iEndRow ) || // other consumes us
( iStartRow <= start && end <= iEndRow ) || // other inside us
( iStartRow <= start && start <= iEndRow ) || // other overlaps us
( iStartRow <= end && end <= iEndRow ); // other overlaps us
}
bool RangeOverlaps( const HoldNote &hn ) const { return RangeOverlaps(hn.iStartRow, hn.iEndRow); }
bool RangeInside( int start, int end ) const { return iStartRow <= start && end <= iEndRow; }
float GetStartBeat() const { return NoteRowToBeat( iStartRow ); }
float GetEndBeat() const { return NoteRowToBeat( iEndRow ); }
int iTrack;
int iStartRow;
int iEndRow;
};
#endif