some work to make it possible to start with incomplete songs (without

music)
This commit is contained in:
Glenn Maynard
2002-09-07 06:26:00 +00:00
parent 811b90524f
commit e992012de2
+9 -3
View File
@@ -412,9 +412,11 @@ void Song::TidyUpData()
throw RageException( "The song in '%s' is missing a music file. You must place a music file in the song folder or remove the song", m_sSongDir );
}
RageSoundStream sound;
sound.Load( GetMusicPath() );
m_fMusicLengthSeconds = sound.GetLengthSeconds();
if(m_sMusicFile != "") {
RageSoundStream sound;
sound.Load( GetMusicPath() );
m_fMusicLengthSeconds = sound.GetLengthSeconds();
}
@@ -570,6 +572,10 @@ void Song::GetNotesThatMatch( const StyleDef *s, int p, CArray<Notes*, Notes*>&
/* Return whether the song is playable in the given style. */
bool Song::SongCompleteForStyle( const StyleDef *st ) const
{
/* If we don't have music, we're not complete. */
if(m_sMusicFile == "")
return false;
for( int pn = 0; pn < NUM_PLAYERS; ++pn )
{
if(st->m_NotesTypes[pn] == NOTES_TYPE_INVALID) continue; /* unused */