From 706b2eee10c57e4d6b10a4be626936f20c4323bc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 31 Oct 2003 23:17:14 +0000 Subject: [PATCH] don't write unneeded data to disk --- stepmania/src/SongManager.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 2e6e9627fa..c049b9c595 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -714,13 +714,24 @@ void SongManager::SaveStepsMemCardDataToFile( CString fn, int mc ) Song* pSong = m_pSongs[s]; ASSERT(pSong); - vector vNotes = pSong->m_apNotes; - if( vNotes.size() == 0 ) - continue; // skip + /* If the song has never been played, don't write anything. This keeps + * us from saving a dozen copies of each song for all autogen difficulties, + * since most people only use a couple game modes. */ + vector vNotes; + for( unsigned i=0; im_apNotes.size(); ++i ) + { + Steps* pNotes = pSong->m_apNotes[i]; + if( !pNotes->m_MemCardDatas[mc].iNumTimesPlayed ) + continue; + vNotes.push_back( pNotes ); + } FileWrite( f, pSong->GetSongDir() ); FileWrite( f, vNotes.size() ); + if( vNotes.size() == 0 ) + continue; // skip + for( unsigned n=0; n