Ensure all BM* files have a BGM track.

This commit is contained in:
Jason Felds
2011-06-20 19:00:22 -04:00
parent c4b0fb555e
commit 0498ad5f70
+9
View File
@@ -696,6 +696,8 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
}
NameToData_t::const_iterator it;
bool hasBGM = false;
for( it = mapNameToData.lower_bound("#00000"); it != mapNameToData.end(); ++it )
{
const RString &sName = it->first;
@@ -745,6 +747,7 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
{
if( bmsTrack == BMS_AUTO_KEYSOUND_1 )
{
hasBGM = true;
// shift the auto keysound as far right as possible
int iLastEmptyTrack = -1;
if( ndNotes.GetTapLastEmptyTrack(row, iLastEmptyTrack) &&
@@ -772,6 +775,12 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
}
}
if (!hasBGM)
{
LOG->Warn("The song at %s is missing a #XXX01 tag! We're unable to load.", sPath.c_str());
return false;
}
/* Handles hold notes like uBMPlay.
* Different BMS simulators support hold notes differently.
* See http://nvyu.net/rdm/ex.php for more info.