only write new values to cache

This commit is contained in:
Glenn Maynard
2003-11-26 17:41:32 +00:00
parent 82c9c8bbb7
commit b439bae638
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -91,7 +91,7 @@ void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out)
}
void NotesWriterSM::WriteSMNotesTag( const Steps &in, FILE* fp )
void NotesWriterSM::WriteSMNotesTag( const Steps &in, FILE* fp, bool bSavingCache )
{
fprintf( fp, "\n//---------------%s - %s----------------\n",
GameManager::NotesTypeToString(in.m_StepsType).c_str(), in.GetDescription().c_str() );
@@ -101,8 +101,9 @@ void NotesWriterSM::WriteSMNotesTag( const Steps &in, FILE* fp )
fprintf( fp, " %s:\n", DifficultyToString(in.GetDifficulty()).c_str() );
fprintf( fp, " %d:\n", in.GetMeter() );
int MaxRadar = bSavingCache? NUM_RADAR_CATEGORIES:5;
CStringArray asRadarValues;
for( int r=0; r < NUM_RADAR_CATEGORIES; r++ )
for( int r=0; r < MaxRadar; r++ )
asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) );
/* Don't append a newline here; it's added in NoteDataUtil::GetSMNoteDataString.
* If we add it here, then every time we write unmodified data we'll add an extra
@@ -150,7 +151,7 @@ bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
if( pNotes->IsAutogen() )
continue; /* don't write autogen notes */
WriteSMNotesTag( *out.m_apNotes[i], fp );
WriteSMNotesTag( *out.m_apNotes[i], fp, bSavingCache );
}
fclose( fp );