Applied time signature fix to SMALoader::ProcessBeatsPerMeasure()
This commit is contained in:
+15
-1
@@ -48,6 +48,7 @@ void SMALoader::ProcessMultipliers( TimingData &out, const int iRowsPerBeat, con
|
||||
void SMALoader::ProcessBeatsPerMeasure( TimingData &out, const RString sParam )
|
||||
{
|
||||
std::vector<RString> vs1;
|
||||
std::vector<TimeSignatureSegment> segments;
|
||||
split( sParam, ",", vs1 );
|
||||
|
||||
for (RString const &s1 : vs1)
|
||||
@@ -82,8 +83,21 @@ void SMALoader::ProcessBeatsPerMeasure( TimingData &out, const RString sParam )
|
||||
fBeat, iNumerator );
|
||||
continue;
|
||||
}
|
||||
segments.push_back( TimeSignatureSegment(BeatToNoteRow(fBeat), iNumerator) );
|
||||
}
|
||||
|
||||
out.AddSegment( TimeSignatureSegment(BeatToNoteRow(fBeat), iNumerator) );
|
||||
// If there are any time signatures defined, but there isn't one
|
||||
// for the very first beat of the song, then add one.
|
||||
// Without it, calls to functions like TimingData::NoteRowToMeasureAndBeat
|
||||
// can fail for charts that are otherwise valid.
|
||||
if ( segments.size() > 0 && segments[0].GetRow() > 0 )
|
||||
{
|
||||
out.AddSegment( TimeSignatureSegment(0, 4, 4) );
|
||||
}
|
||||
|
||||
for( TimeSignatureSegment segment: segments )
|
||||
{
|
||||
out.AddSegment( segment );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user