[warps] Load the warps.
Now, the fun part...implementation.
This commit is contained in:
@@ -486,6 +486,35 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if( sValueName=="WARPS" )
|
||||||
|
{
|
||||||
|
vector<RString> arrayWarpExpressions;
|
||||||
|
split( sParams[1], ",", arrayWarpExpressions );
|
||||||
|
|
||||||
|
for( unsigned b=0; b<arrayWarpExpressions.size(); b++ )
|
||||||
|
{
|
||||||
|
vector<RString> arrayWarpValues;
|
||||||
|
split( arrayWarpExpressions[b], "=", arrayWarpValues );
|
||||||
|
// XXX: Hard to tell which file caused this.
|
||||||
|
if( arrayWarpValues.size() != 2 )
|
||||||
|
{
|
||||||
|
LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid #%s value \"%s\" (must have exactly one '='), ignored.",
|
||||||
|
sValueName.c_str(), arrayWarpExpressions[b].c_str() );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float fBeat = StringToFloat( arrayWarpValues[0] );
|
||||||
|
const float fNewBeat = StringToFloat( arrayWarpValues[1] );
|
||||||
|
|
||||||
|
if(fNewBeat > fBeat)
|
||||||
|
out.m_Timing.AddWarpSegment( WarpSegment(BeatToNoteRow(fBeat), fNewBeat) );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid Warp at beat %f, BPM %f.", fBeat, fNewBeat );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if( sValueName=="TIMESIGNATURES" )
|
else if( sValueName=="TIMESIGNATURES" )
|
||||||
{
|
{
|
||||||
vector<RString> vs1;
|
vector<RString> vs1;
|
||||||
|
|||||||
Reference in New Issue
Block a user