Merge pull request #1010 from nixtrix/firstsecond

Checking for first second now ignores autokeysounds
This commit is contained in:
Kyzentun
2016-03-13 08:47:22 -06:00
3 changed files with 11 additions and 4 deletions
+10 -2
View File
@@ -422,7 +422,7 @@ int NoteData::GetFirstRow() const
for( int t=0; t < GetNumTracks(); t++ )
{
int iRow = -1;
if( !GetNextTapNoteRowForTrack( t, iRow ) )
if( !GetNextTapNoteRowForTrack( t, iRow, true ) )
continue;
if( iEarliestRowFoundSoFar == -1 )
@@ -972,7 +972,7 @@ int NoteData::GetNumTracksHeldAtRow( int row )
return viTracks.size();
}
bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut ) const
bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut, bool ignoreAutoKeysounds ) const
{
const TrackMap &mapTrack = m_TapNotes[track];
@@ -987,6 +987,14 @@ bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut ) const
return false;
ASSERT( iter->first > rowInOut );
// If we want to ignore autokeysounds, keep going until we find a real note.
if(ignoreAutoKeysounds) {
while(iter->second.type == TapNoteType_AutoKeysound) {
iter++;
if(iter==mapTrack.end()) return false;
}
}
rowInOut = iter->first;
return true;
}
+1 -1
View File
@@ -243,7 +243,7 @@ public:
/* Returns the row of the first TapNote on the track that has a row greater than rowInOut. */
bool GetNextTapNoteRowForTrack( int track, int &rowInOut ) const;
bool GetNextTapNoteRowForTrack( int track, int &rowInOut, bool ignoreKeySounds=false ) const;
bool GetNextTapNoteRowForAllTracks( int &rowInOut ) const;
bool GetPrevTapNoteRowForTrack( int track, int &rowInOut ) const;
bool GetPrevTapNoteRowForAllTracks( int &rowInOut ) const;
-1
View File
@@ -1118,7 +1118,6 @@ bool BMSChartReader::ReadNoteData()
TimingData td;
td.m_fBeat0OffsetInSeconds = out->m_Timing.m_fBeat0OffsetInSeconds;
nd.SetNumTracks( tracks );
td.SetBPMAtRow( 0, currentBPM = initialBPM );