From b439bae6387d25b2f58d53f1b998b6fd94105a6e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 26 Nov 2003 17:41:32 +0000 Subject: [PATCH] only write new values to cache --- stepmania/src/NotesWriterSM.cpp | 7 ++++--- stepmania/src/NotesWriterSM.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index 9cd0ff64fb..afa6e95c5e 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -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 ); diff --git a/stepmania/src/NotesWriterSM.h b/stepmania/src/NotesWriterSM.h index 0108e41260..254008401f 100644 --- a/stepmania/src/NotesWriterSM.h +++ b/stepmania/src/NotesWriterSM.h @@ -6,7 +6,7 @@ class NotesWriterSM { void WriteGlobalTags(FILE *fp, const Song &out); - void WriteSMNotesTag( const Steps &in, FILE* fp ); + void WriteSMNotesTag( const Steps &in, FILE* fp, bool bSavingCache ); public: bool Write( CString sPath, const Song &out, bool bSavingCache );