Only write step timing/attack tags when needed.

This commit is contained in:
Jason Felds
2011-08-02 22:30:54 -04:00
parent 1969486243
commit 114a5de8ad
7 changed files with 96 additions and 333 deletions
+4
View File
@@ -9,6 +9,10 @@ change to JSON, but it is unsure if this will be done.
Implement .ssc at your own risk.
_______________________________________________________________________________
[v0.78] - Wolfman2000
* Use the step timing/attack tags only when required. The presence of even
ONE timing tag causes all to be used, so be careful with it.
[v0.77] - Wolfman2000
* Add the cache tag #STEPFILENAME to gain access to the proper #NOTES when
required.
+6
View File
@@ -8,6 +8,12 @@ ________________________________________________________________________________
StepMania 5.0 Preview 3 | 20110???
--------------------------------------------------------------------------------
2011/08/02
----------
* [NotesSSC] Only write timing/attack tags for the step if there is a
difference from the song. For timing tags, at this time it means that if even
one tag is different, all tags are written. [Wolfman2000]
2011/08/01
----------
* [MusicWheel, RoomWheel] Moved the "- EMPTY -" string to the languages file. [AJ]
@@ -60,45 +60,6 @@
#METER:11;
#RADARVALUES:0.954,1.000,0.629,0.600,0.500,572.000,66.000,63.000,128.000,0.000,0.000,0.000,0.000,0.954,1.000,0.629,0.600,0.500,572.000,66.000,63.000,128.000,0.000,0.000,0.000,0.000;
#CREDIT:Wyde;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
0000
0000
@@ -1015,45 +976,6 @@ M000
#METER:10;
#RADARVALUES:0.805,0.790,0.457,0.695,0.233,471.000,48.000,73.000,25.000,0.000,0.000,0.000,0.000,0.805,0.790,0.457,0.695,0.233,471.000,48.000,73.000,25.000,0.000,0.000,0.000,0.000;
#CREDIT:Wyde;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
0000
0000
@@ -1862,45 +1784,6 @@ M100
#METER:8;
#RADARVALUES:0.605,0.602,0.429,0.476,0.019,350.000,45.000,50.000,0.000,0.000,0.000,0.000,0.000,0.605,0.602,0.429,0.476,0.019,350.000,45.000,50.000,0.000,0.000,0.000,0.000,0.000;
#CREDIT:Wyde;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
0000
0000
@@ -2533,45 +2416,6 @@ M100
#METER:6;
#RADARVALUES:0.484,0.527,0.324,0.495,0.000,270.000,34.000,52.000,0.000,0.000,0.000,0.000,0.000,0.484,0.527,0.324,0.495,0.000,270.000,34.000,52.000,0.000,0.000,0.000,0.000,0.000;
#CREDIT:Wyde;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
0000
0000
@@ -3116,45 +2960,6 @@ M100
#METER:2;
#RADARVALUES:0.265,0.289,0.181,0.171,0.000,158.000,19.000,18.000,2.000,0.000,0.000,0.000,0.000,0.265,0.289,0.181,0.171,0.000,158.000,19.000,18.000,2.000,0.000,0.000,0.000,0.000;
#CREDIT:Wyde;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
0000
0000
@@ -3590,7 +3395,6 @@ M00M
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
000000
000000
@@ -7006,45 +6810,6 @@ M0000
#METER:3;
#RADARVALUES:0.253,0.362,0.095,0.419,0.000,132.000,10.000,44.000,0.000,0.000,0.000,0.000,0.000,0.253,0.362,0.095,0.419,0.000,132.000,10.000,44.000,0.000,0.000,0.000,0.000,0.000;
#CREDIT:Jason Felds;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
00000000
00000000
@@ -7446,45 +7211,6 @@ M0000
#METER:2;
#RADARVALUES:0.144,0.214,0.105,0.000,0.000,95.000,11.000,0.000,0.000,0.000,0.000,0.000,0.000,0.144,0.214,0.105,0.000,0.000,95.000,11.000,0.000,0.000,0.000,0.000,0.000,0.000;
#CREDIT:Jason Felds;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=2
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
000
000
@@ -7877,45 +7603,6 @@ M0000
#METER:11;
#RADARVALUES:0.589,0.891,0.400,0.610,0.019,333.000,42.000,64.000,0.000,0.000,0.000,6.000,0.000,0.589,0.891,0.400,0.610,0.019,333.000,42.000,64.000,0.000,0.000,0.000,6.000,0.000;
#CREDIT:Jason Felds;
#OFFSET:-0.028000;
#BPMS:0.000000=180.000000
;
#STOPS:;
#DELAYS:;
#WARPS:;
#TIMESIGNATURES:0.000000=4=4
;
#TICKCOUNTS:0.000000=4
;
#COMBOS:0.000000=1
;
#SPEEDS:0.000000=1.000000=0.000000=0
;
#SCROLLS:0.000000=1.000000
;
#FAKES:;
#LABELS:0.000000=Song Start
,16.000000=Verse 1A
,32.000000=Verse 1B
,48.000000=Verse 2A
,64.000000=Verse 2B
,80.000000=Verse 3A
,96.000000=Verse 3B
,112.000000=Verse 4A
,128.000000=Verse 4B
,144.000000=Verse 5A
,160.000000=Verse 5B
,176.000000=Verse 6A
,192.000000=Verse 6B
,208.000000=Verse 7A
,224.000000=Verse 7B
,240.000000=Verse 8A
,256.000000=Verse 8B
,272.000000=Verse 9A
,288.000000=Verse 9B
,304.000000=Fin
;
#ATTACKS:;
#NOTES:
// measure 0
000000
+11
View File
@@ -630,51 +630,61 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
else if( sValueName=="STOPS" )
{
SMLoader::ProcessStops(stepsTiming, sParams[1]);
bHasOwnTiming = true;
}
else if( sValueName=="DELAYS" )
{
SMLoader::ProcessDelays(stepsTiming, sParams[1]);
bHasOwnTiming = true;
}
else if( sValueName=="TIMESIGNATURES" )
{
SMLoader::ProcessTimeSignatures(stepsTiming, sParams[1]);
bHasOwnTiming = true;
}
else if( sValueName=="TICKCOUNTS" )
{
SMLoader::ProcessTickcounts(stepsTiming, sParams[1]);
bHasOwnTiming = true;
}
else if( sValueName=="COMBOS" )
{
ProcessCombos(stepsTiming, sParams[1]);
bHasOwnTiming = true;
}
else if( sValueName=="WARPS" )
{
ProcessWarps(stepsTiming, sParams[1], out.m_fVersion);
bHasOwnTiming = true;
}
else if( sValueName=="SPEEDS" )
{
ProcessSpeeds( stepsTiming, sParams[1] );
bHasOwnTiming = true;
}
else if( sValueName=="SCROLLS" )
{
ProcessScrolls( stepsTiming, sParams[1] );
bHasOwnTiming = true;
}
else if( sValueName=="FAKES" )
{
ProcessFakes( stepsTiming, sParams[1] );
bHasOwnTiming = true;
}
else if( sValueName=="LABELS" )
{
ProcessLabels(stepsTiming, sParams[1]);
bHasOwnTiming = true;
}
/* If this is called, the chart does not use the same attacks
* as the Song's timing. No other changes are required. */
@@ -687,6 +697,7 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
else if( sValueName=="OFFSET" )
{
stepsTiming.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] );
bHasOwnTiming = true;
}
else if( sValueName=="DISPLAYBPM" )
+1 -1
View File
@@ -41,7 +41,7 @@
* @brief The internal version of the cache for StepMania.
*
* Increment this value to invalidate the current cache. */
const int FILE_CACHE_VERSION = 200;
const int FILE_CACHE_VERSION = 201;
/** @brief How long does a song sample last by default? */
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;
+1 -1
View File
@@ -20,7 +20,7 @@ void FixupPath( RString &path, const RString &sSongPath );
RString GetSongAssetPath( RString sPath, const RString &sSongPath );
/** @brief The version of the .ssc file format. */
const static float STEPFILE_VERSION_NUMBER = 0.77f;
const static float STEPFILE_VERSION_NUMBER = 0.78f;
/** @brief How many edits for this song can each profile have? */
const int MAX_EDITS_PER_SONG_PER_PROFILE = 15;
+73 -18
View File
@@ -738,6 +738,9 @@ public:
bool HasScrollChanges() const;
/**
* @brief Compare two sets of timing data to see if they are equal.
*
* TODO: Make doubly sure that we're using the operator== on the proper segments,
* not the generic TimingSegment.
* @param other the other TimingData.
* @return the equality or lack thereof of the two TimingData.
*/
@@ -745,80 +748,132 @@ public:
{
unsigned i;
#define COMPARE_SEGMENT(kind, tst, i) \
if (static_cast<kind *>(this->allTimingSegments[tst][i]) != \
static_cast<kind *>(other.allTimingSegments[tst][i])) \
return false
COMPARE(allTimingSegments[SEGMENT_BPM].size());
for (i = 0; i < allTimingSegments[SEGMENT_BPM].size(); i++)
{
COMPARE_SEGMENT(BPMSegment, SEGMENT_BPM, i);
BPMSegment * segT =
static_cast<BPMSegment *>(this->allTimingSegments[SEGMENT_BPM][i]);
BPMSegment * segO =
static_cast<BPMSegment *>(other.allTimingSegments[SEGMENT_BPM][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetBPS() != segO->GetBPS()) return false;
}
COMPARE(allTimingSegments[SEGMENT_STOP].size());
for (i = 0; i < allTimingSegments[SEGMENT_STOP].size(); i++)
{
COMPARE_SEGMENT(StopSegment, SEGMENT_STOP, i);
StopSegment * segT =
static_cast<StopSegment *>(this->allTimingSegments[SEGMENT_STOP][i]);
StopSegment * segO =
static_cast<StopSegment *>(other.allTimingSegments[SEGMENT_STOP][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetPause() != segO->GetPause()) return false;
}
COMPARE(allTimingSegments[SEGMENT_DELAY].size());
for (i = 0; i < allTimingSegments[SEGMENT_DELAY].size(); i++)
{
COMPARE_SEGMENT(DelaySegment, SEGMENT_DELAY, i);
DelaySegment * segT =
static_cast<DelaySegment *>(this->allTimingSegments[SEGMENT_DELAY][i]);
DelaySegment * segO =
static_cast<DelaySegment *>(other.allTimingSegments[SEGMENT_DELAY][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetPause() != segO->GetPause()) return false;
}
COMPARE(allTimingSegments[SEGMENT_WARP].size());
for (i = 0; i < allTimingSegments[SEGMENT_WARP].size(); i++)
{
COMPARE_SEGMENT(WarpSegment, SEGMENT_WARP, i);
WarpSegment * segT =
static_cast<WarpSegment *>(this->allTimingSegments[SEGMENT_WARP][i]);
WarpSegment * segO =
static_cast<WarpSegment *>(other.allTimingSegments[SEGMENT_WARP][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetLength() != segO->GetLength()) return false;
}
COMPARE(allTimingSegments[SEGMENT_TIME_SIG].size());
for (i = 0; i < allTimingSegments[SEGMENT_TIME_SIG].size(); i++)
{
COMPARE_SEGMENT(TimeSignatureSegment, SEGMENT_TIME_SIG, i);
TimeSignatureSegment * segT =
static_cast<TimeSignatureSegment *>(this->allTimingSegments[SEGMENT_TIME_SIG][i]);
TimeSignatureSegment * segO =
static_cast<TimeSignatureSegment *>(other.allTimingSegments[SEGMENT_TIME_SIG][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetNum() != segO->GetNum()) return false;
if (segT->GetDen() != segO->GetDen()) return false;
}
COMPARE(allTimingSegments[SEGMENT_TICKCOUNT].size());
for (i = 0; i < allTimingSegments[SEGMENT_TICKCOUNT].size(); i++)
{
COMPARE_SEGMENT(TickcountSegment, SEGMENT_TICKCOUNT, i);
TickcountSegment * segT =
static_cast<TickcountSegment *>(this->allTimingSegments[SEGMENT_TICKCOUNT][i]);
TickcountSegment * segO =
static_cast<TickcountSegment *>(other.allTimingSegments[SEGMENT_TICKCOUNT][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetTicks() != segO->GetTicks()) return false;
}
COMPARE(allTimingSegments[SEGMENT_COMBO].size());
for (i = 0; i < allTimingSegments[SEGMENT_COMBO].size(); i++)
{
COMPARE_SEGMENT(ComboSegment, SEGMENT_COMBO, i);
ComboSegment * segT =
static_cast<ComboSegment *>(this->allTimingSegments[SEGMENT_COMBO][i]);
ComboSegment * segO =
static_cast<ComboSegment *>(other.allTimingSegments[SEGMENT_COMBO][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetCombo() != segO->GetCombo()) return false;
if (segT->GetMissCombo() != segO->GetMissCombo()) return false;
}
COMPARE(allTimingSegments[SEGMENT_SPEED].size());
for (i = 0; i < allTimingSegments[SEGMENT_SPEED].size(); i++)
{
COMPARE_SEGMENT(SpeedSegment, SEGMENT_SPEED, i);
SpeedSegment * segT =
static_cast<SpeedSegment *>(this->allTimingSegments[SEGMENT_SPEED][i]);
SpeedSegment * segO =
static_cast<SpeedSegment *>(other.allTimingSegments[SEGMENT_SPEED][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetRatio() != segO->GetRatio()) return false;
if (segT->GetLength() != segO->GetLength()) return false;
if (segT->GetUnit() != segO->GetUnit()) return false;
}
COMPARE(allTimingSegments[SEGMENT_SCROLL].size());
for (i = 0; i < allTimingSegments[SEGMENT_SCROLL].size(); i++)
{
COMPARE_SEGMENT(ScrollSegment, SEGMENT_SCROLL, i);
ScrollSegment * segT =
static_cast<ScrollSegment *>(this->allTimingSegments[SEGMENT_SCROLL][i]);
ScrollSegment * segO =
static_cast<ScrollSegment *>(other.allTimingSegments[SEGMENT_SCROLL][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetRatio() != segO->GetRatio()) return false;
}
COMPARE(allTimingSegments[SEGMENT_LABEL].size());
for (i = 0; i < allTimingSegments[SEGMENT_LABEL].size(); i++)
{
COMPARE_SEGMENT(LabelSegment, SEGMENT_LABEL, i);
LabelSegment * segT =
static_cast<LabelSegment *>(this->allTimingSegments[SEGMENT_LABEL][i]);
LabelSegment * segO =
static_cast<LabelSegment *>(other.allTimingSegments[SEGMENT_LABEL][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetLabel() != segO->GetLabel()) return false;
}
COMPARE(allTimingSegments[SEGMENT_FAKE].size());
for (i = 0; i < allTimingSegments[SEGMENT_FAKE].size(); i++)
{
COMPARE_SEGMENT(FakeSegment, SEGMENT_FAKE, i);
FakeSegment * segT =
static_cast<FakeSegment *>(this->allTimingSegments[SEGMENT_FAKE][i]);
FakeSegment * segO =
static_cast<FakeSegment *>(other.allTimingSegments[SEGMENT_FAKE][i]);
if (segT->GetRow() != segO->GetRow()) return false;
if (segT->GetLength() != segO->GetLength()) return false;
}
COMPARE( m_fBeat0OffsetInSeconds );
#undef COMPARE_SEGMENT
return true;
}
/**