Replacing use of CalculateRadarValues with CalculateStepStats, and ReCalculateRadarValuesAndLastSecond with ReCalculateStepStatsAndLastSecond
This commit is contained in:
+2
-2
@@ -3438,7 +3438,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[main_player_];
|
||||
ASSERT(pSteps != nullptr);
|
||||
pSteps->SetNoteData(m_NoteDataEdit);
|
||||
m_pSong->ReCalculateRadarValuesAndLastSecond();
|
||||
m_pSong->ReCalculateStepStatsAndLastSecond();
|
||||
|
||||
// TODO: Background videos don't support seeking, when they do, make sure
|
||||
// to load the appropriate part of the video.
|
||||
@@ -4472,7 +4472,7 @@ void ScreenEdit::PerformSave(bool autosave)
|
||||
ASSERT( m_pSteps->IsAnEdit() );
|
||||
|
||||
RString sError;
|
||||
m_pSteps->CalculateRadarValues( m_pSong->m_fMusicLengthSeconds );
|
||||
m_pSteps->CalculateStepStats( m_pSong->m_fMusicLengthSeconds );
|
||||
if( !NotesWriterSM::WriteEditFileToMachine(m_pSong, m_pSteps, sError) )
|
||||
{
|
||||
ScreenPrompt::Prompt( SM_None, sError );
|
||||
|
||||
+8
-7
@@ -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.
|
||||
|
||||
+2
-2
@@ -108,11 +108,11 @@ public:
|
||||
void TidyUpData( bool fromCache = false, bool duringCache = false );
|
||||
|
||||
/**
|
||||
* @brief Get the new radar values, and determine the last second at the same time.
|
||||
* @brief Get the new step stats, and determine the last second at the same time.
|
||||
* This is called by TidyUpData, after saving the Song.
|
||||
* @param fromCache was this data loaded from the cache file?
|
||||
* @param duringCache was this data loaded during the cache process? */
|
||||
void ReCalculateRadarValuesAndLastSecond(bool fromCache = false, bool duringCache = false);
|
||||
void ReCalculateStepStatsAndLastSecond(bool fromCache = false, bool duringCache = false);
|
||||
/**
|
||||
* @brief Translate any titles that aren't in english.
|
||||
* This is called by TidyUpData. */
|
||||
|
||||
Reference in New Issue
Block a user