I need to pull more often.
This commit is contained in:
+1
-45
@@ -211,50 +211,6 @@ void ArrowEffects::Update()
|
||||
}
|
||||
}
|
||||
|
||||
float GetSpeedMultiplier( float fSongBeat, float fMusicSeconds, const TimingData &tim )
|
||||
{
|
||||
if( tim.m_SpeedSegments.size() == 0 )
|
||||
return 1.0;
|
||||
|
||||
const int index = tim.GetSpeedSegmentIndexAtBeat( fSongBeat );
|
||||
|
||||
const SpeedSegment &seg = tim.m_SpeedSegments[index];
|
||||
float fStartBeat = NoteRowToBeat(seg.m_iStartRow);
|
||||
float fStartTime = tim.GetElapsedTimeFromBeat( fStartBeat ) - tim.GetDelayAtBeat( fStartBeat );
|
||||
float fEndTime;
|
||||
float fCurTime = fMusicSeconds;
|
||||
|
||||
if( seg.m_usMode == 1 ) // seconds
|
||||
{
|
||||
fEndTime = fStartTime + seg.m_fWait;
|
||||
}
|
||||
else
|
||||
{
|
||||
fEndTime = tim.GetElapsedTimeFromBeat( fStartBeat + seg.m_fWait ) - tim.GetDelayAtBeat( fStartBeat + seg.m_fWait );
|
||||
}
|
||||
|
||||
if( ( index == 0 && tim.m_SpeedSegments[0].m_fWait > 0.0 ) && fCurTime < fStartTime )
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
else if( fEndTime >= fCurTime && ( index > 0 || tim.m_SpeedSegments[0].m_fWait > 0.0 ) )
|
||||
{
|
||||
const float fPriorSpeed = ( index == 0 ? 1 : tim.m_SpeedSegments[index - 1].m_fPercent );
|
||||
float fTimeUsed = fCurTime - fStartTime;
|
||||
float fDuration = fEndTime - fStartTime;
|
||||
float fRatioUsed = fDuration == 0.0 ? 1 : fTimeUsed / fDuration;
|
||||
|
||||
float fDistance = fPriorSpeed - seg.m_fPercent;
|
||||
float fRatioNeed = fRatioUsed * -fDistance;
|
||||
return (fPriorSpeed + fRatioNeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
return seg.m_fPercent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* For visibility testing: if bAbsolute is false, random modifiers must return
|
||||
* the minimum possible scroll speed. */
|
||||
float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float fNoteBeat, float &fPeakYOffsetOut, bool &bIsPastPeakOut, bool bAbsolute )
|
||||
@@ -277,7 +233,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
|
||||
{
|
||||
float fBeatsUntilStep = fNoteBeat - fSongBeat;
|
||||
float fYOffsetBeatSpacing = fBeatsUntilStep;
|
||||
float fSpeedMultiplier = ( GAMESTATE->m_bInStepEditor || !GAMESTATE->m_bIsUsingStepTiming ) ? 1.0 : GetSpeedMultiplier( position.m_fSongBeatVisible, position.m_fMusicSecondsVisible, pCurSteps->m_Timing );
|
||||
float fSpeedMultiplier = ( GAMESTATE->m_bInStepEditor || !GAMESTATE->m_bIsUsingStepTiming ) ? 1.0 : pCurSteps->m_Timing.GetDisplayedSpeedPercent( position.m_fSongBeatVisible, position.m_fMusicSecondsVisible );
|
||||
fYOffset += fSpeedMultiplier * fYOffsetBeatSpacing * (1-pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing);
|
||||
}
|
||||
|
||||
|
||||
@@ -708,6 +708,7 @@ float FindLastDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistanceB
|
||||
// Adjust search distance so that notes don't pop onto the screen.
|
||||
float fSearchDistance = 10;
|
||||
float fLastBeatToDraw = GetDisplayedPosition(pPlayerState)->m_fSongBeat+fSearchDistance;
|
||||
float fSpeedMultiplier = GetDisplayedTiming(pPlayerState)->GetDisplayedSpeedPercent(GetDisplayedPosition(pPlayerState)->m_fSongBeatVisible, GetDisplayedPosition(pPlayerState)->m_fMusicSecondsVisible);
|
||||
|
||||
const int NUM_ITERATIONS = 20;
|
||||
|
||||
@@ -733,6 +734,11 @@ float FindLastDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistanceB
|
||||
fSearchDistance /= 2;
|
||||
}
|
||||
|
||||
if( fSpeedMultiplier < 0.75 )
|
||||
{
|
||||
fLastBeatToDraw = min(fLastBeatToDraw, GetDisplayedPosition(pPlayerState)->m_fSongBeat + 16);
|
||||
}
|
||||
|
||||
return fLastBeatToDraw;
|
||||
}
|
||||
|
||||
|
||||
@@ -1183,14 +1183,17 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
Steps* pNewNotes = apSteps[i];
|
||||
const bool ok = LoadFromBMSFile( out.GetSongDir() + arrayBMSFileNames[i], aBMSData[i], *pNewNotes, out, mapFilenameToKeysoundIndex );
|
||||
if( ok )
|
||||
{
|
||||
// set song's timing data to the main file.
|
||||
if( i == iMainDataIndex )
|
||||
out.m_SongTiming = pNewNotes->m_Timing;
|
||||
|
||||
out.AddSteps( pNewNotes );
|
||||
}
|
||||
else
|
||||
delete pNewNotes;
|
||||
}
|
||||
|
||||
// set song's timing data to the main file.
|
||||
out.m_SongTiming = apSteps[iMainDataIndex]->m_Timing;
|
||||
|
||||
SlideDuplicateDifficulties( out );
|
||||
|
||||
ConvertString( out.m_sMainTitle, "utf-8,japanese" );
|
||||
|
||||
+6
-4
@@ -3204,6 +3204,8 @@ void ScreenEdit::DisplayTimingMenu()
|
||||
{
|
||||
float fBeat = GetBeat();
|
||||
TimingData &pTime = GetAppropriateTiming();
|
||||
bool bHasSpeedOnThisRow = pTime.GetSpeedSegmentAtBeat( fBeat ).m_iStartRow == BeatToNoteRow( fBeat );
|
||||
|
||||
g_TimingDataInformation.rows[beat_0_offset].SetOneUnthemedChoice( ssprintf("%.5f", pTime.m_fBeat0OffsetInSeconds) );
|
||||
g_TimingDataInformation.rows[bpm].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetBPMAtBeat( fBeat ) ) );
|
||||
g_TimingDataInformation.rows[stop].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetStopAtBeat( fBeat ) ) ) ;
|
||||
@@ -3213,8 +3215,8 @@ void ScreenEdit::DisplayTimingMenu()
|
||||
g_TimingDataInformation.rows[tickcount].SetOneUnthemedChoice( ssprintf("%d", pTime.GetTickcountAtBeat( fBeat ) ) );
|
||||
g_TimingDataInformation.rows[combo].SetOneUnthemedChoice( ssprintf("%d", pTime.GetComboAtBeat( fBeat ) ) );
|
||||
g_TimingDataInformation.rows[warp].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetWarpAtBeat( fBeat ) ) );
|
||||
g_TimingDataInformation.rows[speed_percent].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetSpeedPercentAtBeat( fBeat ) ) );
|
||||
g_TimingDataInformation.rows[speed_wait].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetSpeedWaitAtBeat( fBeat ) ) );
|
||||
g_TimingDataInformation.rows[speed_percent].SetOneUnthemedChoice( bHasSpeedOnThisRow ? ssprintf("%.5f", pTime.GetSpeedPercentAtBeat( fBeat ) ) : "---" );
|
||||
g_TimingDataInformation.rows[speed_wait].SetOneUnthemedChoice( bHasSpeedOnThisRow ? ssprintf("%.5f", pTime.GetSpeedWaitAtBeat( fBeat ) ) : "---" );
|
||||
|
||||
RString starting = ( pTime.GetSpeedModeAtBeat( fBeat ) == 1 ? "Seconds" : "Beats" );
|
||||
g_TimingDataInformation.rows[speed_mode].SetOneUnthemedChoice( starting.c_str() );
|
||||
@@ -3224,8 +3226,8 @@ void ScreenEdit::DisplayTimingMenu()
|
||||
g_TimingDataInformation.rows[tickcount].bEnabled = GAMESTATE->m_bIsUsingStepTiming;
|
||||
g_TimingDataInformation.rows[combo].bEnabled = GAMESTATE->m_bIsUsingStepTiming;
|
||||
g_TimingDataInformation.rows[speed_percent].bEnabled = GAMESTATE->m_bIsUsingStepTiming;
|
||||
g_TimingDataInformation.rows[speed_wait].bEnabled = GAMESTATE->m_bIsUsingStepTiming;
|
||||
g_TimingDataInformation.rows[speed_mode].bEnabled = GAMESTATE->m_bIsUsingStepTiming;
|
||||
g_TimingDataInformation.rows[speed_wait].bEnabled = GAMESTATE->m_bIsUsingStepTiming && bHasSpeedOnThisRow;
|
||||
g_TimingDataInformation.rows[speed_mode].bEnabled = GAMESTATE->m_bIsUsingStepTiming && bHasSpeedOnThisRow;
|
||||
g_TimingDataInformation.rows[fake].bEnabled = GAMESTATE->m_bIsUsingStepTiming;
|
||||
|
||||
EditMiniMenu( &g_TimingDataInformation, SM_BackFromTimingDataInformation );
|
||||
|
||||
@@ -515,6 +515,7 @@ bool TimingData::IsWarpAtRow( int iNoteRow ) const
|
||||
const WarpSegment& s = m_WarpSegments[i];
|
||||
if( s.m_iStartRow <= iNoteRow && iNoteRow < (s.m_iStartRow + BeatToNoteRow(s.m_fLengthBeats) ) )
|
||||
{
|
||||
// Allow stops inside warps to allow things like stop, warp, stop, warp, stop, and so on.
|
||||
if( m_StopSegments.empty() )
|
||||
{
|
||||
return true;
|
||||
@@ -1341,6 +1342,50 @@ void TimingData::DeleteRows( int iStartRow, int iRowsToDelete )
|
||||
this->SetBPMAtRow( iStartRow, fNewBPM );
|
||||
}
|
||||
|
||||
float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds ) const
|
||||
{
|
||||
if( m_SpeedSegments.size() == 0 )
|
||||
return 1.0;
|
||||
|
||||
const int index = GetSpeedSegmentIndexAtBeat( fSongBeat );
|
||||
|
||||
const SpeedSegment &seg = m_SpeedSegments[index];
|
||||
float fStartBeat = NoteRowToBeat(seg.m_iStartRow);
|
||||
float fStartTime = GetElapsedTimeFromBeat( fStartBeat ) - GetDelayAtBeat( fStartBeat );
|
||||
float fEndTime;
|
||||
float fCurTime = fMusicSeconds;
|
||||
|
||||
if( seg.m_usMode == 1 ) // seconds
|
||||
{
|
||||
fEndTime = fStartTime + seg.m_fWait;
|
||||
}
|
||||
else
|
||||
{
|
||||
fEndTime = GetElapsedTimeFromBeat( fStartBeat + seg.m_fWait ) - GetDelayAtBeat( fStartBeat + seg.m_fWait );
|
||||
}
|
||||
|
||||
if( ( index == 0 && m_SpeedSegments[0].m_fWait > 0.0 ) && fCurTime < fStartTime )
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
else if( fEndTime >= fCurTime && ( index > 0 || m_SpeedSegments[0].m_fWait > 0.0 ) )
|
||||
{
|
||||
const float fPriorSpeed = ( index == 0 ? 1 : m_SpeedSegments[index - 1].m_fPercent );
|
||||
float fTimeUsed = fCurTime - fStartTime;
|
||||
float fDuration = fEndTime - fStartTime;
|
||||
float fRatioUsed = fDuration == 0.0 ? 1 : fTimeUsed / fDuration;
|
||||
|
||||
float fDistance = fPriorSpeed - seg.m_fPercent;
|
||||
float fRatioNeed = fRatioUsed * -fDistance;
|
||||
return (fPriorSpeed + fRatioNeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
return seg.m_fPercent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TimingData::TidyUpData()
|
||||
{
|
||||
// If there are no BPM segments, provide a default.
|
||||
|
||||
@@ -1594,6 +1594,8 @@ public:
|
||||
*/
|
||||
void AddSpeedSegment( const SpeedSegment &seg );
|
||||
|
||||
float GetDisplayedSpeedPercent( float fBeat, float fMusicSeconds ) const;
|
||||
|
||||
/**
|
||||
* @brief Determine when the fakes end.
|
||||
* @param iRow The row you start on.
|
||||
|
||||
Reference in New Issue
Block a user