Skip to content

Commit

Permalink
Update to BGCHANGES and others
Browse files Browse the repository at this point in the history
  • Loading branch information
sillybear committed Feb 7, 2018
1 parent 852f27c commit 622f7c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/NotesWriterSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ void NotesWriterSM::WriteGlobalTags( RageFile &f, const Song &out, bool bSavingC
write_tag( f, "#OFFSET:%s;", FormatDouble("%.3f", out.m_Timing.m_fBeat0OffsetInSeconds) );

write_tag( f, "#SAMPLESTART:%s;", FormatDouble("%.3f", out.m_fMusicSampleStartSeconds) );
write_tag( f, "#SAMPLELENGTH:%s;", FormatDouble("%.3f", out.m_fMusicSampleLengthSeconds) );
write_tag( f, "#SAMPLELENGTH:%s;", "15" );
//write_tag( f, "#SAMPLELENGTH:%s;", FormatDouble("%.3f", out.m_fMusicSampleLengthSeconds) );

switch(out.m_SelectionDisplay)
{
Expand Down Expand Up @@ -116,7 +117,7 @@ void NotesWriterSM::WriteGlobalTags( RageFile &f, const Song &out, bool bSavingC
}
write_tag( f, "#STOPS:%s;", join(",", stopLines) );

if( out.m_BackgroundChanges.size() )
if( out.m_BackgroundChanges.size() > 1 || (!out.m_BackgroundChanges.empty() && out.m_BackgroundChanges[0].m_fStartBeat != 0) )
{
f.Write( "#BGCHANGES:" );
for( unsigned i=0; i<out.m_BackgroundChanges.size(); i++ )
Expand Down Expand Up @@ -175,6 +176,7 @@ static void WriteLineList( RageFile &f, vector<CString> &lines, bool SkipLeading
{
for( unsigned i = 0; i < lines.size(); ++i )
{
TrimLeft( lines[i] );
TrimRight( lines[i] );
if( SkipLeadingBlankLines )
{
Expand Down Expand Up @@ -221,14 +223,17 @@ void NotesWriterSM::WriteSMNotesTag( const Steps &in, RageFile &f, bool bSavingC
/* 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
* newline and they'll accumulate. */
f.Write( ssprintf( " %s:", join(",",asRadarValues).c_str() ) );
f.Write( " :" );
//f.Write( ssprintf( " %s:", join(",",asRadarValues).c_str() ) );

f.PutLine( "" );

CString sNoteData;
CString sAttackData;
in.GetSMNoteData( sNoteData, sAttackData );

vector<CString> lines;

TrimLeft( sNoteData );
split( sNoteData, "\n", lines, false );
WriteLineList( f, lines, true, true );

Expand Down
2 changes: 1 addition & 1 deletion src/PrefsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void PrefsManager::Init()
m_fJudgeWindowAdd = 0;
m_fLifeDifficultyScale = 1.0f;

m_bNoSavePlusFeatures = false;
m_bNoSavePlusFeatures = true;
m_ConvertRatingsScaleDown = MTSCALE_OFF;

m_bPositiveAnnouncerOnly = false;
Expand Down
6 changes: 3 additions & 3 deletions src/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ void Song::Save()

/* Save the new files. These calls make backups on their own. */
SaveToSMFile( GetSongFilePath(), false );
SaveToDWIFile();
//SaveToDWIFile();

//if( IsPlayerSong() )
// SaveToPlayerCacheFile();
Expand Down Expand Up @@ -1161,8 +1161,8 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache )
LOG->Trace( "Song::SaveToSMFile('%s')", sPath.c_str() );

/* If the file exists, make a backup. */
if( !bSavingCache && IsAFile(sPath) )
FileCopy( sPath, sPath + ".old" );
//if( !bSavingCache && IsAFile(sPath) )
// FileCopy( sPath, sPath + ".old" );

NotesWriterSM wr;
wr.Write(sPath, *this, bSavingCache);
Expand Down

0 comments on commit 622f7c4

Please sign in to comment.