[warps] allow stops inside warps and convert high bpm to warps

+ sometimes there are delays/stops in high BPM sections,
  they have to be handled inside a warp to be able to convert
  it easily.
+ on the stopped / delayed rows with warps, judging become
  enabled for that row.

Issues:

+ the bpm threshould is hardcoded (right now it's 400000.0).
  someone change it please.
+ slight off-sync from conversion. haven't figured out how to
  work around it yet.
This commit is contained in:
Thai Pangsakulyanont
2011-03-26 22:07:24 +07:00
parent bfd7e9c914
commit ac336215bd
4 changed files with 73 additions and 60 deletions
+22 -4
View File
@@ -122,6 +122,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
// prepare storage variables for negative BPMs -> Warps.
float negBeat = -1;
float negBPM = 1;
float highspeedBeat = -1;
for( unsigned b=0; b<arrayBPMChangeExpressions.size(); b++ )
{
@@ -157,11 +158,28 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
negBeat = -1;
negBPM = 1;
}
// too fast. make it a warp.
if( fNewBPM > 400000.0 )
{
BPMSegment new_seg;
new_seg.m_iStartRow = BeatToNoteRow(fBeat);
new_seg.SetBPM( fNewBPM );
out.AddBPMSegment( new_seg );
highspeedBeat = fBeat;
}
else
{
// add in a warp.
if( highspeedBeat > 0 )
{
WarpSegment new_seg;
new_seg.m_iStartRow = BeatToNoteRow(highspeedBeat);
new_seg.m_fEndBeat = fBeat;
out.AddWarpSegment( new_seg );
highspeedBeat = -1;
}
{
BPMSegment new_seg;
new_seg.m_iStartRow = BeatToNoteRow(fBeat);
new_seg.SetBPM( fNewBPM );
out.AddBPMSegment( new_seg );
}
}
}
}