No longer store #NOTES in cache.
Use the #STEPFILENAME tag to access the files as appropriate. To the betting pool fans: file cache version is 192.
This commit is contained in:
+40
-40
@@ -180,12 +180,29 @@ static void GetTimingTags( vector<RString> &lines, TimingData timing, bool bIsSo
|
||||
|
||||
static void WriteTimingTags( RageFile &f, const TimingData &timing, bool bIsSong = false )
|
||||
{
|
||||
|
||||
vector<RString> lines;
|
||||
|
||||
GetTimingTags( lines, timing, bIsSong );
|
||||
|
||||
f.PutLine( JoinLineList( lines ) );
|
||||
f.PutLine(ssprintf("#BPMS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_BPM)).c_str()));
|
||||
f.PutLine(ssprintf("#STOPS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_STOP_DELAY, false)).c_str()));
|
||||
f.PutLine(ssprintf("#DELAYS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_STOP_DELAY, true)).c_str()));
|
||||
f.PutLine(ssprintf("#WARPS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_WARP)).c_str()));
|
||||
f.PutLine(ssprintf("#TIMESIGNATURES:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_TIME_SIG)).c_str()));
|
||||
f.PutLine(ssprintf("#TICKCOUNTS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_TICKCOUNT)).c_str()));
|
||||
f.PutLine(ssprintf("#COMBOS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_COMBO)).c_str()));
|
||||
f.PutLine(ssprintf("#SPEEDS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_SPEED)).c_str()));
|
||||
f.PutLine(ssprintf("#SCROLLS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_SCROLL)).c_str()));
|
||||
if (!bIsSong)
|
||||
f.PutLine(ssprintf("#FAKES:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_FAKE)).c_str()));
|
||||
f.PutLine(ssprintf("#LABELS:%s;",
|
||||
join(",\r\n", timing.ToVectorString(SEGMENT_LABEL)).c_str()));
|
||||
|
||||
}
|
||||
|
||||
@@ -212,10 +229,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
|
||||
f.PutLine( ssprintf( "#MUSIC:%s;", SmEscape(out.m_sMusicFile).c_str() ) );
|
||||
|
||||
{
|
||||
vector<RString> vs;
|
||||
FOREACH_ENUM( InstrumentTrack, it )
|
||||
if( out.HasInstrumentTrack(it) )
|
||||
vs.push_back( InstrumentTrackToString(it) + "=" + out.m_sInstrumentTrackFile[it] );
|
||||
vector<RString> vs = out.GetInstrumentTracksToVectorString();
|
||||
if( !vs.empty() )
|
||||
{
|
||||
RString s = join( ",", vs );
|
||||
@@ -229,7 +243,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
|
||||
f.Write( "#SELECTABLE:" );
|
||||
switch(out.m_SelectionDisplay)
|
||||
{
|
||||
default: ASSERT(0); // fall through
|
||||
default: ASSERT_M(0, "An invalid selectable value was found for this song!"); // fall through
|
||||
case Song::SHOW_ALWAYS: f.Write( "YES" ); break;
|
||||
//case Song::SHOW_NONSTOP: f.Write( "NONSTOP" ); break;
|
||||
case Song::SHOW_NEVER: f.Write( "NO" ); break;
|
||||
@@ -297,16 +311,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
|
||||
}
|
||||
f.PutLine( ";" );
|
||||
|
||||
f.Write( "#ATTACKS:" );
|
||||
for( unsigned a=0; a < out.m_sAttackString.size(); a++ )
|
||||
{
|
||||
RString sData = out.m_sAttackString[a];
|
||||
f.Write( ssprintf( "%s", sData.c_str() ) );
|
||||
|
||||
if( a != (out.m_sAttackString.size() - 1) )
|
||||
f.Write( ":" ); // Not the end, so write a divider ':'
|
||||
}
|
||||
f.PutLine( ";" );
|
||||
f.PutLine( ssprintf("#ATTACKS:%s;", out.GetAttackString().c_str()) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,17 +350,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
|
||||
|
||||
GetTimingTags( lines, in.m_Timing );
|
||||
|
||||
RString attacks = "";
|
||||
for( unsigned a=0; a < in.m_sAttackString.size(); a++ )
|
||||
{
|
||||
RString sData = in.m_sAttackString[a];
|
||||
attacks += sData;
|
||||
|
||||
if( a != (in.m_sAttackString.size() - 1) )
|
||||
attacks += ":\r\n"; // Not the end, so write a divider ':'
|
||||
}
|
||||
Trim(attacks, ":"); // just in case something screwy happens.
|
||||
lines.push_back( ssprintf( "#ATTACKS:%s;", attacks.c_str()));
|
||||
lines.push_back( ssprintf("#ATTACKS:%s;", in.GetAttackString().c_str()));
|
||||
|
||||
switch( in.GetDisplayBPM() )
|
||||
{
|
||||
@@ -376,16 +371,21 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
|
||||
lines.push_back( ssprintf( "#DISPLAYBPM:*;" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
RString sNoteData;
|
||||
in.GetSMNoteData( sNoteData );
|
||||
if (bSavingCache)
|
||||
{
|
||||
lines.push_back(ssprintf("#STEPFILENAME:%s;", in.GetFilename().c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
RString sNoteData;
|
||||
in.GetSMNoteData( sNoteData );
|
||||
|
||||
lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" );
|
||||
|
||||
TrimLeft(sNoteData);
|
||||
split( sNoteData, "\n", lines, true );
|
||||
lines.push_back( ";" );
|
||||
lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" );
|
||||
|
||||
TrimLeft(sNoteData);
|
||||
split( sNoteData, "\n", lines, true );
|
||||
lines.push_back( ";" );
|
||||
}
|
||||
return JoinLineList( lines );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user