[warps] Load the warps.
Now, the fun part...implementation.
This commit is contained in:
@@ -485,6 +485,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" )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user