Finish moving ProcessBPMs and ProcessStops together
This commit is contained in:
@@ -801,11 +801,13 @@ bool SMLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache
|
|||||||
}
|
}
|
||||||
else if( sValueName=="BPMS" )
|
else if( sValueName=="BPMS" )
|
||||||
{
|
{
|
||||||
|
vBPMChanges.clear();
|
||||||
ParseBPMs(vBPMChanges, sParams[1]);
|
ParseBPMs(vBPMChanges, sParams[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="STOPS" || sValueName=="FREEZES" )
|
else if( sValueName=="STOPS" || sValueName=="FREEZES" )
|
||||||
{
|
{
|
||||||
|
vStops.clear();
|
||||||
ParseStops(vStops, sParams[1]);
|
ParseStops(vStops, sParams[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-14
@@ -253,6 +253,7 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
Steps* pNewNotes = NULL;
|
Steps* pNewNotes = NULL;
|
||||||
TimingData stepsTiming;
|
TimingData stepsTiming;
|
||||||
bool bHasOwnTiming = false;
|
bool bHasOwnTiming = false;
|
||||||
|
vector< pair<float, float> > vBPMChanges, vStops;
|
||||||
|
|
||||||
for( unsigned i = 0; i < values; i++ )
|
for( unsigned i = 0; i < values; i++ )
|
||||||
{
|
{
|
||||||
@@ -473,9 +474,8 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
* if the steps do not have their own timing. */
|
* if the steps do not have their own timing. */
|
||||||
else if( sValueName=="STOPS" )
|
else if( sValueName=="STOPS" )
|
||||||
{
|
{
|
||||||
vector< pair<float, float> > vStops;
|
vStops.clear();
|
||||||
SMLoader::ParseStops(vStops, sParams[1]);
|
SMLoader::ParseStops(vStops, sParams[1]);
|
||||||
SMLoader::ProcessStops(out.m_SongTiming, vStops);
|
|
||||||
}
|
}
|
||||||
else if( sValueName=="DELAYS" )
|
else if( sValueName=="DELAYS" )
|
||||||
{
|
{
|
||||||
@@ -484,9 +484,8 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
|
|
||||||
else if( sValueName=="BPMS" )
|
else if( sValueName=="BPMS" )
|
||||||
{
|
{
|
||||||
vector< pair<float, float> > vBPMChanges;
|
vBPMChanges.clear();
|
||||||
SMLoader::ParseBPMs(vBPMChanges, sParams[1]);
|
SMLoader::ParseBPMs(vBPMChanges, sParams[1]);
|
||||||
SMLoader::ProcessBPMs(out.m_SongTiming, vBPMChanges);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="WARPS" ) // Older versions allowed em here.
|
else if( sValueName=="WARPS" ) // Older versions allowed em here.
|
||||||
@@ -565,6 +564,10 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
// This tag will get us to the next section.
|
// This tag will get us to the next section.
|
||||||
else if( sValueName=="NOTEDATA" )
|
else if( sValueName=="NOTEDATA" )
|
||||||
{
|
{
|
||||||
|
// Process timings and convert negative bpms/stops
|
||||||
|
SMLoader::ProcessBPMs(out.m_SongTiming, vBPMChanges);
|
||||||
|
SMLoader::ProcessStops(out.m_SongTiming, vStops);
|
||||||
|
|
||||||
state = GETTING_STEP_INFO;
|
state = GETTING_STEP_INFO;
|
||||||
pNewNotes = out.CreateSteps();
|
pNewNotes = out.CreateSteps();
|
||||||
stepsTiming = TimingData( out.m_SongTiming.m_fBeat0OffsetInSeconds );
|
stepsTiming = TimingData( out.m_SongTiming.m_fBeat0OffsetInSeconds );
|
||||||
@@ -650,6 +653,11 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
|
|
||||||
else if( sValueName=="NOTES" || sValueName=="NOTES2" )
|
else if( sValueName=="NOTES" || sValueName=="NOTES2" )
|
||||||
{
|
{
|
||||||
|
// Process timings and convert negative bpms/stops
|
||||||
|
if( SMLoader::ProcessBPMs(stepsTiming, vBPMChanges) )
|
||||||
|
bHasOwnTiming = true;
|
||||||
|
SMLoader::ProcessStops(stepsTiming, vStops);
|
||||||
|
|
||||||
state = GETTING_SONG_INFO;
|
state = GETTING_SONG_INFO;
|
||||||
if( bHasOwnTiming )
|
if( bHasOwnTiming )
|
||||||
pNewNotes->m_Timing = stepsTiming;
|
pNewNotes->m_Timing = stepsTiming;
|
||||||
@@ -663,10 +671,8 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
{
|
{
|
||||||
if (out.m_fVersion >= VERSION_SPLIT_TIMING)
|
if (out.m_fVersion >= VERSION_SPLIT_TIMING)
|
||||||
{
|
{
|
||||||
vector< pair<float, float> > vBPMChanges;
|
vBPMChanges.clear();
|
||||||
SMLoader::ParseBPMs(vBPMChanges, sParams[1]);
|
SMLoader::ParseBPMs(vBPMChanges, sParams[1]);
|
||||||
if( SMLoader::ProcessBPMs(stepsTiming, vBPMChanges) )
|
|
||||||
bHasOwnTiming = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,9 +680,8 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
{
|
{
|
||||||
if (out.m_fVersion >= VERSION_SPLIT_TIMING)
|
if (out.m_fVersion >= VERSION_SPLIT_TIMING)
|
||||||
{
|
{
|
||||||
vector< pair<float, float> > vStops;
|
vStops.clear();
|
||||||
SMLoader::ParseStops(vStops, sParams[1]);
|
SMLoader::ParseStops(vStops, sParams[1]);
|
||||||
SMLoader::ProcessStops(stepsTiming, vStops);
|
|
||||||
bHasOwnTiming = true;
|
bHasOwnTiming = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -799,6 +804,11 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
}
|
}
|
||||||
else if( sValueName=="STEPFILENAME" )
|
else if( sValueName=="STEPFILENAME" )
|
||||||
{
|
{
|
||||||
|
// Process timings and convert negative bpms/stops
|
||||||
|
if( SMLoader::ProcessBPMs(stepsTiming, vBPMChanges) )
|
||||||
|
bHasOwnTiming = true;
|
||||||
|
SMLoader::ProcessStops(stepsTiming, vStops);
|
||||||
|
|
||||||
state = GETTING_SONG_INFO;
|
state = GETTING_SONG_INFO;
|
||||||
if( bHasOwnTiming )
|
if( bHasOwnTiming )
|
||||||
pNewNotes->m_Timing = stepsTiming;
|
pNewNotes->m_Timing = stepsTiming;
|
||||||
@@ -849,6 +859,7 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
|||||||
bool bSSCFormat = false;
|
bool bSSCFormat = false;
|
||||||
bool bHasOwnTiming = false;
|
bool bHasOwnTiming = false;
|
||||||
TimingData stepsTiming;
|
TimingData stepsTiming;
|
||||||
|
vector< pair<float, float> > vBPMChanges, vStops;
|
||||||
|
|
||||||
for( unsigned i=0; i<msd.GetNumValues(); i++ )
|
for( unsigned i=0; i<msd.GetNumValues(); i++ )
|
||||||
{
|
{
|
||||||
@@ -953,18 +964,15 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
|||||||
|
|
||||||
else if( sValueName=="BPMS" )
|
else if( sValueName=="BPMS" )
|
||||||
{
|
{
|
||||||
vector< pair<float, float> > vBPMChanges;
|
vBPMChanges.clear();
|
||||||
SMLoader::ParseBPMs(vBPMChanges, sParams[1]);
|
SMLoader::ParseBPMs(vBPMChanges, sParams[1]);
|
||||||
if( SMLoader::ProcessBPMs(stepsTiming, vBPMChanges) )
|
|
||||||
bHasOwnTiming = true;
|
|
||||||
bSSCFormat = true;
|
bSSCFormat = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="STOPS" )
|
else if( sValueName=="STOPS" )
|
||||||
{
|
{
|
||||||
vector< pair<float, float> > vStops;
|
vStops.clear();
|
||||||
SMLoader::ParseStops(vStops, sParams[1]);
|
SMLoader::ParseStops(vStops, sParams[1]);
|
||||||
SMLoader::ProcessStops(stepsTiming, vStops);
|
|
||||||
bSSCFormat = true;
|
bSSCFormat = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1037,6 +1045,11 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
|||||||
if( !bAddStepsToSong )
|
if( !bAddStepsToSong )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Process timings and convert negative bpms/stops
|
||||||
|
if( SMLoader::ProcessBPMs(stepsTiming, vBPMChanges) )
|
||||||
|
bHasOwnTiming = true;
|
||||||
|
SMLoader::ProcessStops(stepsTiming, vStops);
|
||||||
|
|
||||||
if( bSSCFormat )
|
if( bSSCFormat )
|
||||||
{
|
{
|
||||||
if ( bHasOwnTiming )
|
if ( bHasOwnTiming )
|
||||||
|
|||||||
Reference in New Issue
Block a user