This commit is contained in:
Glenn Maynard
2005-01-22 19:25:05 +00:00
parent cd9b66220a
commit a769bc7c41
4 changed files with 15 additions and 24 deletions
-18
View File
@@ -25,11 +25,6 @@ NoteData::~NoteData()
{ {
} }
int NoteData::GetNumTracks() const
{
return m_TapNotes.size();
}
void NoteData::SetNumTracks( int iNewNumTracks ) void NoteData::SetNumTracks( int iNewNumTracks )
{ {
ASSERT( iNewNumTracks > 0 ); ASSERT( iNewNumTracks > 0 );
@@ -284,19 +279,6 @@ int NoteData::GetMatchingHoldNote( const HoldNote &hn ) const
FAIL_M( ssprintf("%i..%i, %i", hn.iStartRow, hn.iEndRow, hn.iTrack) ); FAIL_M( ssprintf("%i..%i, %i", hn.iStartRow, hn.iEndRow, hn.iTrack) );
} }
void NoteData::SetTapAttackNote( int track, int row, CString sModifiers, float fDurationSeconds )
{
TapNote tn(
TapNote::attack,
TapNote::original,
sModifiers,
fDurationSeconds,
false,
0 );
SetTapNote( track, row, tn );
}
int NoteData::GetFirstRow() const int NoteData::GetFirstRow() const
{ {
int iEarliestRowFoundSoFar = -1; int iEarliestRowFoundSoFar = -1;
+1 -4
View File
@@ -41,7 +41,7 @@ public:
~NoteData(); ~NoteData();
void Init(); void Init();
int GetNumTracks() const; int GetNumTracks() const { return m_TapNotes.size(); }
void SetNumTracks( int iNewNumTracks ); void SetNumTracks( int iNewNumTracks );
/* Return the note at the given track and row. Row may be out of /* Return the note at the given track and row. Row may be out of
@@ -105,9 +105,6 @@ public:
const HoldNote &GetHoldNote( int index ) const { ASSERT( index < (int) m_HoldNotes.size() ); return m_HoldNotes[index]; } const HoldNote &GetHoldNote( int index ) const { ASSERT( index < (int) m_HoldNotes.size() ); return m_HoldNotes[index]; }
int GetMatchingHoldNote( const HoldNote &hn ) const; int GetMatchingHoldNote( const HoldNote &hn ) const;
// remove me
void SetTapAttackNote( int track, int row, CString sModifiers, float fDurationSeconds );
// //
// statistics // statistics
// //
+7 -1
View File
@@ -1564,7 +1564,13 @@ void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong )
float fBeat = pSong->GetBeatFromElapsedTime( sec ); float fBeat = pSong->GetBeatFromElapsedTime( sec );
int iBeat = (int)fBeat; int iBeat = (int)fBeat;
int iTrack = iBeat % nd.GetNumTracks(); // deterministically calculates track int iTrack = iBeat % nd.GetNumTracks(); // deterministically calculates track
nd.SetTapAttackNote( iTrack, BeatToNoteRow(fBeat), szAttacks[rand()%ARRAYSIZE(szAttacks)], 15 ); TapNote tn(
TapNote::attack, TapNote::original,
szAttacks[rand()%ARRAYSIZE(szAttacks)],
15.0f,
false,
0 );
nd.SetTapNote( iTrack, BeatToNoteRow(fBeat), tn );
} }
} }
+7 -1
View File
@@ -1564,7 +1564,13 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
CString sMods = poChosen.GetString(); CString sMods = poChosen.GetString();
const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat ); const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat );
m_NoteDataEdit.SetTapAttackNote( g_iLastInsertAttackTrack, row, sMods, g_fLastInsertAttackDurationSeconds ); TapNote tn(
TapNote::attack, TapNote::original,
sMods,
g_fLastInsertAttackDurationSeconds,
false,
0 );
m_NoteDataEdit.SetTapNote( g_iLastInsertAttackTrack, row, tn );
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
} }
break; break;