From 35748ed9a79a9352dc9f758bed13d9baea29b07a Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Fri, 11 Feb 2011 00:45:00 -0500 Subject: [PATCH] Update comments, tidy. --- src/MsdFile.h | 2 +- src/RageFileManager.cpp | 4 ++-- src/Song.cpp | 33 +++++++++++++++++++++------------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/MsdFile.h b/src/MsdFile.h index b18ed60342..7086b44c2c 100644 --- a/src/MsdFile.h +++ b/src/MsdFile.h @@ -1,4 +1,4 @@ -/* MsdFile - Read .SM, .DWI, and .MSD files. */ +/* MsdFile - Read .SSC, .SM, .DWI, and .MSD files. */ #ifndef MSDFILE_H #define MSDFILE_H diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 22304916b1..deaa84bc2c 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -838,8 +838,8 @@ RageFileBasic *RageFileManager::OpenForWriting( const RString &sPath, int mode, * * The purpose of this is to create files in the expected place. For example, if we * have both C:/games/StepMania and C:/games/DWI loaded, and we're writing - * "Songs/Music/Waltz/waltz.sm", and the song was loaded out of - * "C:/games/DWI/Songs/Music/Waltz/waltz.dwi", we want to write the new SM into the + * "Songs/Music/Waltz/waltz.ssc", and the song was loaded out of + * "C:/games/DWI/Songs/Music/Waltz/waltz.dwi", we want to write the new SSC into the * same directory (if possible). Don't split up files in the same directory any * more than we have to. * diff --git a/src/Song.cpp b/src/Song.cpp index 55d0545c8b..4f44ac884a 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -709,7 +709,7 @@ void Song::TidyUpData() { /* Generated filename; this doesn't always point to a loadable file, * but instead points to the file we should write changed files to, - * and will always be an .SM. + * and will always be a .SSC. * * This is a little tricky. We can't always use the song title directly, * since it might contain characters we can't store in filenames. Two @@ -723,23 +723,32 @@ void Song::TidyUpData() * but not KSFs and BMSs. * * So, let's do this (by priority): - * 1. If there's an .SM file, use that filename. No reason to use anything + * 1. If there's a .SSC file, use that filename. No reason to use anything * else; it's the filename in use. - * 2. If there's a .DWI, use it with a changed extension. - * 3. Otherwise, use the name of the directory, since it's definitely a valid + * 2. If there's an .SM, use it with a changed extension. + * 3. If there's a .DWI, use it with a changed extension. + * 4. Otherwise, use the name of the directory, since it's definitely a valid * filename, and should always be the title of the song (unlike KSFs). */ m_sSongFileName = m_sSongDir; vector asFileNames; - GetDirListing( m_sSongDir+"*.sm", asFileNames ); + GetDirListing( m_sSongDir+"*.ssc", asFileNames ); if( !asFileNames.empty() ) + { m_sSongFileName += asFileNames[0]; - else { - GetDirListing( m_sSongDir+"*.dwi", asFileNames ); - if( !asFileNames.empty() ) { - m_sSongFileName += SetExtension( asFileNames[0], "sm" ); - } else { - m_sSongFileName += Basename(m_sSongDir); - m_sSongFileName += ".sm"; + } + else + { + GetDirListing( m_sSongDir+"*.sm", asFileNames ); + if( !asFileNames.empty() ) + m_sSongFileName += SetExtension( asFileNames[0], "ssc" ); + else { + GetDirListing( m_sSongDir+"*.dwi", asFileNames ); + if( !asFileNames.empty() ) { + m_sSongFileName += SetExtension( asFileNames[0], "ssc" ); + } else { + m_sSongFileName += Basename(m_sSongDir); + m_sSongFileName += ".ssc"; + } } } }