Add parameters to BackgroundChange: fRate, bFadeLast, bRewindMovie, bLoop.

I don't like how this changes the syntax for the #BGCHANGES tag in an SM file.  I will think more about this - it's important to finalize it quickly.
This commit is contained in:
Chris Danford
2003-04-14 04:10:01 +00:00
parent 5ea408a547
commit cfe1f9ec67
20 changed files with 125 additions and 62 deletions
+17 -8
View File
@@ -232,17 +232,26 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
split( aBGChangeExpressions[b], "=", aBGChangeValues );
/* XXX: Once we have a way to display warnings that the user actually
* cares about (unlike most warnings), this should be one of them. */
if(aBGChangeValues.size() != 2)
BackgroundChange change;
switch( aBGChangeValues.size() )
{
LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored",
case 6:
change.m_fRate = (float)atof( aBGChangeValues[2] );
change.m_bFadeLast = atoi( aBGChangeValues[3] ) != 0;
change.m_bRewindMovie = atoi( aBGChangeValues[4] ) != 0;
change.m_bLoop = atoi( aBGChangeValues[5] ) != 0;
// fall through
case 2:
change.m_fStartBeat = (float)atof( aBGChangeValues[0] );
change.m_sBGName = aBGChangeValues[1];
out.AddBackgroundChange( change );
break;
default:
LOG->Warn("Invalid #BGCHANGES%s value \"%s\" was ignored",
sValueName.GetString(), aBGChangeExpressions[b].GetString());
continue;
break;
}
float fBeat = (float)atof( aBGChangeValues[0] );
CString sBGName = aBGChangeValues[1];
sBGName.MakeLower();
out.AddBackgroundChange( BackgroundChange(fBeat, sBGName) );
}
}