Replacing use of CalculateRadarValues with CalculateStepStats, and ReCalculateRadarValuesAndLastSecond with ReCalculateStepStatsAndLastSecond

This commit is contained in:
Michael Votaw
2025-02-11 19:39:03 -08:00
committed by teejusb
parent afa44ee4df
commit bd897b676a
3 changed files with 12 additions and 11 deletions
+8 -7
View File
@@ -1110,7 +1110,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ )
/* Generate these before we autogen notes, so the new notes can inherit
* their source's values. */
ReCalculateRadarValuesAndLastSecond(from_cache, true);
ReCalculateStepStatsAndLastSecond(from_cache, true);
// If the music length is suspiciously shorter than the last second, adjust
// the length. This prevents the ogg patch from setting a false length. -Kyz
if(m_fMusicLengthSeconds < lastSecond - 10.0f)
@@ -1131,13 +1131,15 @@ void Song::TranslateTitles()
m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit );
}
void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache)
void Song::ReCalculateStepStatsAndLastSecond(bool fromCache, bool duringCache)
{
if( fromCache && this->GetFirstSecond() >= 0 && this->GetLastSecond() > 0 )
{
// this is loaded from cache, then we just have to calculate the radar values.
for( unsigned i=0; i<m_vpSteps.size(); i++ )
m_vpSteps[i]->CalculateRadarValues( m_fMusicLengthSeconds );
{
m_vpSteps[i]->CalculateStepStats( m_fMusicLengthSeconds );
}
return;
}
@@ -1148,9 +1150,8 @@ void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache)
for( unsigned i=0; i<m_vpSteps.size(); i++ )
{
Steps* pSteps = m_vpSteps[i];
pSteps->CalculateRadarValues( m_fMusicLengthSeconds );
pSteps->CalculateStepStats(m_fMusicLengthSeconds);
// Must initialize before the gotos.
NoteData tempNoteData;
pSteps->GetNoteData( tempNoteData );
@@ -1214,7 +1215,7 @@ void Song::Save(bool autosave)
{
LOG->Trace( "Song::SaveToSongFile()" );
ReCalculateRadarValuesAndLastSecond();
ReCalculateStepStatsAndLastSecond();
TranslateTitles();
// Save the new files. These calls make backups on their own.