Restore storing to 6 decimals.

This commit is contained in:
Jason Felds
2013-01-06 21:15:36 -05:00
parent 7bc9295508
commit ada0c3cdd0
2 changed files with 26 additions and 26 deletions
+17 -17
View File
@@ -44,16 +44,16 @@ struct TimingTagWriter {
void Write( const int row, const char *value )
{
m_pvsLines->push_back( m_sNext + ssprintf( "%.3f=%s", NoteRowToBeat(row), value ) );
m_pvsLines->push_back( m_sNext + ssprintf( "%.6f=%s", NoteRowToBeat(row), value ) );
m_sNext = ",";
}
void Write( const int row, const float value ) { Write( row, ssprintf( "%.3f", value ) ); }
void Write( const int row, const float value ) { Write( row, ssprintf( "%.6f", value ) ); }
void Write( const int row, const int value ) { Write( row, ssprintf( "%d", value ) ); }
void Write( const int row, const int a, const int b ) { Write( row, ssprintf( "%d=%d", a, b ) ); }
void Write( const int row, const float a, const float b ) { Write( row, ssprintf( "%.3f=%.3f", a, b) ); }
void Write( const int row, const float a, const float b ) { Write( row, ssprintf( "%.6f=%.6f", a, b) ); }
void Write( const int row, const float a, const float b, const unsigned short c )
{ Write( row, ssprintf( "%.3f=%.3f=%hd", a, b, c) ); }
{ Write( row, ssprintf( "%.6f=%.6f=%hd", a, b, c) ); }
void Init( const RString sTag ) { m_sNext = "#" + sTag + ":"; }
void Finish( ) { m_pvsLines->push_back( ( m_sNext != "," ? m_sNext : "" ) + ";" ); }
@@ -239,9 +239,9 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
f.PutLine( "#INSTRUMENTTRACK:" + s + ";\n" );
}
}
f.PutLine( ssprintf( "#OFFSET:%.3f;", out.m_SongTiming.m_fBeat0OffsetInSeconds ) );
f.PutLine( ssprintf( "#SAMPLESTART:%.3f;", out.m_fMusicSampleStartSeconds ) );
f.PutLine( ssprintf( "#SAMPLELENGTH:%.3f;", out.m_fMusicSampleLengthSeconds ) );
f.PutLine( ssprintf( "#OFFSET:%.6f;", out.m_SongTiming.m_fBeat0OffsetInSeconds ) );
f.PutLine( ssprintf( "#SAMPLESTART:%.6f;", out.m_fMusicSampleStartSeconds ) );
f.PutLine( ssprintf( "#SAMPLELENGTH:%.6f;", out.m_fMusicSampleLengthSeconds ) );
f.Write( "#SELECTABLE:" );
switch(out.m_SelectionDisplay)
@@ -260,9 +260,9 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
break;
case DISPLAY_BPM_SPECIFIED:
if( out.m_fSpecifiedBPMMin == out.m_fSpecifiedBPMMax )
f.PutLine( ssprintf( "#DISPLAYBPM:%.3f;", out.m_fSpecifiedBPMMin ) );
f.PutLine( ssprintf( "#DISPLAYBPM:%.6f;", out.m_fSpecifiedBPMMin ) );
else
f.PutLine( ssprintf( "#DISPLAYBPM:%.3f:%.3f;", out.m_fSpecifiedBPMMin, out.m_fSpecifiedBPMMax ) );
f.PutLine( ssprintf( "#DISPLAYBPM:%.6f:%.6f;", out.m_fSpecifiedBPMMin, out.m_fSpecifiedBPMMax ) );
break;
case DISPLAY_BPM_RANDOM:
f.PutLine( ssprintf( "#DISPLAYBPM:*;" ) );
@@ -272,7 +272,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
WriteTimingTags( f, out.m_SongTiming, true );
if( out.GetSpecifiedLastSecond() > 0 )
f.PutLine( ssprintf("#LASTSECONDHINT:%.3f;", out.GetSpecifiedLastSecond()) );
f.PutLine( ssprintf("#LASTSECONDHINT:%.6f;", out.GetSpecifiedLastSecond()) );
FOREACH_BackgroundLayer( b )
{
@@ -363,7 +363,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
{
const RadarValues &rv = in.GetRadarValues( pn );
FOREACH_ENUM( RadarCategory, rc )
asRadarValues.push_back( ssprintf("%.3f", rv[rc]) );
asRadarValues.push_back( ssprintf("%.6f", rv[rc]) );
}
lines.push_back( ssprintf( "#RADARVALUES:%s;", join(",",asRadarValues).c_str() ) );
@@ -372,7 +372,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
// XXX: Is there a better way to write this?
if (const_cast<TimingData &>(song.m_SongTiming) != in.m_Timing)
{
lines.push_back( ssprintf( "#OFFSET:%.3f;", in.m_Timing.m_fBeat0OffsetInSeconds ) );
lines.push_back( ssprintf( "#OFFSET:%.f;", in.m_Timing.m_fBeat0OffsetInSeconds ) );
GetTimingTags( lines, in.m_Timing );
}
@@ -390,9 +390,9 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
float small = in.GetMinBPM();
float big = in.GetMaxBPM();
if (small == big)
lines.push_back( ssprintf( "#DISPLAYBPM:%.3f;", small ) );
lines.push_back( ssprintf( "#DISPLAYBPM:%.6f;", small ) );
else
lines.push_back( ssprintf( "#DISPLAYBPM:%.3f:%.3f;", small, big ) );
lines.push_back( ssprintf( "#DISPLAYBPM:%.6f:%.6f;", small, big ) );
break;
}
case DISPLAY_BPM_RANDOM:
@@ -439,12 +439,12 @@ bool NotesWriterSSC::Write( RString sPath, const Song &out, const vector<Steps*>
if( bSavingCache )
{
f.PutLine( ssprintf( "// cache tags:" ) );
f.PutLine( ssprintf( "#FIRSTSECOND:%.3f;", out.GetFirstSecond() ) );
f.PutLine( ssprintf( "#LASTSECOND:%.3f;", out.GetLastSecond() ) );
f.PutLine( ssprintf( "#FIRSTSECOND:%.6f;", out.GetFirstSecond() ) );
f.PutLine( ssprintf( "#LASTSECOND:%.6f;", out.GetLastSecond() ) );
f.PutLine( ssprintf( "#SONGFILENAME:%s;", out.m_sSongFileName.c_str() ) );
f.PutLine( ssprintf( "#HASMUSIC:%i;", out.m_bHasMusic ) );
f.PutLine( ssprintf( "#HASBANNER:%i;", out.m_bHasBanner ) );
f.PutLine( ssprintf( "#MUSICLENGTH:%.3f;", out.m_fMusicLengthSeconds ) );
f.PutLine( ssprintf( "#MUSICLENGTH:%.6f;", out.m_fMusicLengthSeconds ) );
f.PutLine( ssprintf( "// end cache tags" ) );
}