[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:
+48
-36
@@ -348,7 +348,19 @@ bool TimingData::IsWarpAtRow( int iNoteRow ) const
|
||||
|
||||
int i = GetWarpSegmentIndexAtRow( iNoteRow );
|
||||
const WarpSegment& s = m_WarpSegments[i];
|
||||
return s.m_iStartRow <= iNoteRow && iNoteRow < BeatToNoteRow(s.m_fEndBeat);
|
||||
if( s.m_iStartRow <= iNoteRow && iNoteRow < BeatToNoteRow(s.m_fEndBeat) )
|
||||
{
|
||||
if( m_StopSegments.empty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if( GetStopAtRow(iNoteRow) != 0.0f )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int TimingData::GetTimeSignatureSegmentIndexAtRow( int iRow ) const
|
||||
@@ -499,11 +511,6 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
|
||||
iEventRow = BeatToNoteRow(fWarpDestination);
|
||||
iEventType = FOUND_WARP_DESTINATION;
|
||||
}
|
||||
if( itWS != m_WarpSegments.end() && itWS->m_iStartRow < iEventRow )
|
||||
{
|
||||
iEventRow = itWS->m_iStartRow;
|
||||
iEventType = FOUND_WARP;
|
||||
}
|
||||
if( itBPMS != m_BPMSegments.end() && itBPMS->m_iStartRow < iEventRow )
|
||||
{
|
||||
iEventRow = itBPMS->m_iStartRow;
|
||||
@@ -514,6 +521,11 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
|
||||
iEventRow = itSS->m_iStartRow;
|
||||
iEventType = FOUND_STOP;
|
||||
}
|
||||
if( itWS != m_WarpSegments.end() && itWS->m_iStartRow < iEventRow )
|
||||
{
|
||||
iEventRow = itWS->m_iStartRow;
|
||||
iEventType = FOUND_WARP;
|
||||
}
|
||||
if( iEventType == NOT_FOUND )
|
||||
{
|
||||
break;
|
||||
@@ -530,22 +542,12 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
|
||||
case FOUND_WARP_DESTINATION:
|
||||
bIsWarping = false;
|
||||
break;
|
||||
case FOUND_WARP:
|
||||
bIsWarping = true;
|
||||
if( itWS->m_fEndBeat > fWarpDestination )
|
||||
{
|
||||
fWarpDestination = itWS->m_fEndBeat;
|
||||
}
|
||||
iWarpBeginOut = iEventRow;
|
||||
fWarpDestinationOut = fWarpDestination;
|
||||
itWS ++;
|
||||
break;
|
||||
case FOUND_BPM_CHANGE:
|
||||
fBPS = itBPMS->m_fBPS;
|
||||
itBPMS ++;
|
||||
break;
|
||||
case FOUND_STOP: // TODO: update for Delays.
|
||||
fTimeToNextEvent = bIsWarping ? 0 : itSS->m_fStopSeconds;
|
||||
fTimeToNextEvent = itSS->m_fStopSeconds;
|
||||
fNextEventTime = fLastTime + fTimeToNextEvent;
|
||||
const bool bIsDelay = itSS->m_bDelay;
|
||||
if ( fElapsedTime < fNextEventTime )
|
||||
@@ -559,6 +561,16 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
|
||||
fLastTime = fNextEventTime;
|
||||
itSS ++;
|
||||
break;
|
||||
case FOUND_WARP:
|
||||
bIsWarping = true;
|
||||
if( itWS->m_fEndBeat > fWarpDestination )
|
||||
{
|
||||
fWarpDestination = itWS->m_fEndBeat;
|
||||
}
|
||||
iWarpBeginOut = iEventRow;
|
||||
fWarpDestinationOut = fWarpDestination;
|
||||
itWS ++;
|
||||
break;
|
||||
}
|
||||
iLastRow = iEventRow;
|
||||
}
|
||||
@@ -599,17 +611,12 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const
|
||||
iEventRow = BeatToNoteRow(fWarpDestination);
|
||||
iEventType = FOUND_WARP_DESTINATION;
|
||||
}
|
||||
if( itWS != m_WarpSegments.end() && itWS->m_iStartRow < iEventRow )
|
||||
{
|
||||
iEventRow = itWS->m_iStartRow;
|
||||
iEventType = FOUND_WARP;
|
||||
}
|
||||
if( itBPMS != m_BPMSegments.end() && itBPMS->m_iStartRow < iEventRow )
|
||||
{
|
||||
iEventRow = itBPMS->m_iStartRow;
|
||||
iEventType = FOUND_BPM_CHANGE;
|
||||
}
|
||||
if( itSS != m_StopSegments.end() && itSS->m_bDelay && itSS->m_iStartRow < iEventRow )
|
||||
if( itSS != m_StopSegments.end() && itSS->m_bDelay && itSS->m_iStartRow < iEventRow ) // delays (come before marker)
|
||||
{
|
||||
iEventRow = itSS->m_iStartRow;
|
||||
iEventType = FOUND_STOP;
|
||||
@@ -619,11 +626,16 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const
|
||||
iEventRow = BeatToNoteRow(fBeat);
|
||||
iEventType = FOUND_MARKER;
|
||||
}
|
||||
if( itSS != m_StopSegments.end() && !itSS->m_bDelay && itSS->m_iStartRow < iEventRow )
|
||||
if( itSS != m_StopSegments.end() && !itSS->m_bDelay && itSS->m_iStartRow < iEventRow ) // stops (come after marker)
|
||||
{
|
||||
iEventRow = itSS->m_iStartRow;
|
||||
iEventType = FOUND_STOP;
|
||||
}
|
||||
if( itWS != m_WarpSegments.end() && itWS->m_iStartRow < iEventRow )
|
||||
{
|
||||
iEventRow = itWS->m_iStartRow;
|
||||
iEventType = FOUND_WARP;
|
||||
}
|
||||
float fTimeToNextEvent = bIsWarping ? 0 : NoteRowToBeat( iEventRow - iLastRow ) / fBPS;
|
||||
float fNextEventTime = fLastTime + fTimeToNextEvent;
|
||||
fLastTime = fNextEventTime;
|
||||
@@ -632,6 +644,18 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const
|
||||
case FOUND_WARP_DESTINATION:
|
||||
bIsWarping = false;
|
||||
break;
|
||||
case FOUND_BPM_CHANGE:
|
||||
fBPS = itBPMS->m_fBPS;
|
||||
itBPMS ++;
|
||||
break;
|
||||
case FOUND_STOP:
|
||||
fTimeToNextEvent = itSS->m_fStopSeconds;
|
||||
fNextEventTime = fLastTime + fTimeToNextEvent;
|
||||
fLastTime = fNextEventTime;
|
||||
itSS ++;
|
||||
break;
|
||||
case FOUND_MARKER:
|
||||
return fLastTime;
|
||||
case FOUND_WARP:
|
||||
bIsWarping = true;
|
||||
if( itWS->m_fEndBeat > fWarpDestination )
|
||||
@@ -640,18 +664,6 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const
|
||||
}
|
||||
itWS ++;
|
||||
break;
|
||||
case FOUND_BPM_CHANGE:
|
||||
fBPS = itBPMS->m_fBPS;
|
||||
itBPMS ++;
|
||||
break;
|
||||
case FOUND_STOP:
|
||||
fTimeToNextEvent = bIsWarping ? 0 : itSS->m_fStopSeconds;
|
||||
fNextEventTime = fLastTime + fTimeToNextEvent;
|
||||
fLastTime = fNextEventTime;
|
||||
itSS ++;
|
||||
break;
|
||||
case FOUND_MARKER:
|
||||
return fLastTime;
|
||||
}
|
||||
iLastRow = iEventRow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user