[scroll] 90% of scroll segments

This commit is contained in:
Thai Pangsakulyanont
2011-05-25 22:44:41 +07:00
parent e7df4edbe1
commit fe9573975c
11 changed files with 326 additions and 1 deletions
+35
View File
@@ -176,6 +176,36 @@ void SSCLoader::ProcessSpeeds( TimingData &out, const RString sParam )
}
}
void SSCLoader::ProcessScrolls( TimingData &out, const RString sParam )
{
vector<RString> vs1;
split( sParam, ",", vs1 );
FOREACH_CONST( RString, vs1, s1 )
{
vector<RString> vs2;
split( *s1, "=", vs2 );
if( vs2.size() < 2 )
{
LOG->UserLog( "Song file", "(UNKNOWN)", "has an scroll change with %i values.", (int)vs2.size() );
continue;
}
const float fBeat = StringToFloat( vs2[0] );
ScrollSegment seg( fBeat, StringToFloat( vs2[1] ) );
if( fBeat < 0 )
{
LOG->UserLog( "Song file", "(UNKNOWN)", "has an scroll change with beat %f.", fBeat );
continue;
}
out.AddScrollSegment( seg );
}
}
void SSCLoader::ProcessFakes( TimingData &out, const RString sParam )
{
vector<RString> arrayFakeExpressions;
@@ -601,6 +631,11 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach
ProcessSpeeds( stepsTiming, sParams[1] );
}
else if( sValueName=="SCROLLS" )
{
ProcessScrolls( stepsTiming, sParams[1] );
}
else if( sValueName=="FAKES" )
{
ProcessFakes( stepsTiming, sParams[1] );