ignore #FIRSTBEAT and #LASTBEAT except in cache

This commit is contained in:
Glenn Maynard
2003-01-25 08:10:51 +00:00
parent 4ea9aa7de7
commit ad4f34ca0b
3 changed files with 25 additions and 1 deletions
+16
View File
@@ -115,11 +115,27 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
else if( 0==stricmp(sValueName,"MUSICLENGTH") )
out.m_fMusicLengthSeconds = (float)atof( sParams[1] );
/* We calculate these. Some SMs in circulation have bogus values for
* these, so make sure we always calculate it ourself. */
else if( 0==stricmp(sValueName,"FIRSTBEAT") )
{
if(!FromCache)
{
LOG->Trace("Ignored #FIRSTBEAT (cache only)");
continue;
}
out.m_fFirstBeat = (float)atof( sParams[1] );
}
else if( 0==stricmp(sValueName,"LASTBEAT") )
{
if(!FromCache)
{
LOG->Trace("Ignored #LASTBEAT (cache only)");
continue;
}
out.m_fLastBeat = (float)atof( sParams[1] );
}
else if( 0==stricmp(sValueName,"SAMPLESTART") )
out.m_fMusicSampleStartSeconds = TimeToSeconds( sParams[1] );