diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index d2f1de05d0..6530bfcf90 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -210,17 +210,45 @@ void Song::GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, fl } +float Song::GetElapsedTimeFromBeat( float fBeat ) const +{ + float fElapsedTime = -m_fBeat0OffsetInSeconds; + + for( unsigned j=0; j= fBeat ) + break; + fElapsedTime += m_StopSegments[j].m_fStopSeconds; + } + + for( unsigned i=0; im_fMusicLengthSeconds/2; // seconds float fSecondsToMove = fElapsedTimeBestGuess; // seconds float fBeatOut, fBPSOut; bool bFreezeOut; - /* 0.001 gives higher precision and *takes about 7 more iterations than + /* 0.001 gives higher precision and takes about 7 more iterations than * 0.100. A 90-second song took about 9 iterations; now it takes about * 16. -glenn */ while( fSecondsToMove > 0.001f ) @@ -242,6 +270,7 @@ float Song::GetElapsedTimeFromBeat( float fBeat ) const } return fElapsedTimeBestGuess; +#endif } CString Song::GetCacheFilePath() const