Remove m_sDir. It seems like passing sDir to LoadFromDir is pointless since it should already be set in out.GetSongDir(), or is that a bug? Shouldn't SetSongDir() be called?
This commit is contained in:
@@ -715,12 +715,6 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BMSLoader::GetApplicableFiles( const RString &sPath, vector<RString> &out )
|
|
||||||
{
|
|
||||||
GetDirListing( sPath + RString("*.bms"), out );
|
|
||||||
GetDirListing( sPath + RString("*.bme"), out );
|
|
||||||
}
|
|
||||||
|
|
||||||
void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, MeasureToTimeSig_t &sigAdjustmentsOut )
|
void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, MeasureToTimeSig_t &sigAdjustmentsOut )
|
||||||
{
|
{
|
||||||
RString sData;
|
RString sData;
|
||||||
@@ -743,7 +737,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %f.",
|
LOG->UserLog( "Song file", out.GetSongDir(), "has an invalid BPM change at beat %f, BPM %f.",
|
||||||
NoteRowToBeat(0), fBPM );
|
NoteRowToBeat(0), fBPM );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -778,7 +772,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !IsAFile(out.GetSongDir()+sData) )
|
if( !IsAFile(out.GetSongDir()+sData) )
|
||||||
LOG->UserLog( "Song file", m_sDir, "references key \"%s\" that can't be found", sData.c_str() );
|
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
|
||||||
|
|
||||||
sWavID.MakeUpper(); // HACK: undo the MakeLower()
|
sWavID.MakeUpper(); // HACK: undo the MakeLower()
|
||||||
out.m_vsKeysoundFile.push_back( sData );
|
out.m_vsKeysoundFile.push_back( sData );
|
||||||
@@ -825,7 +819,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %d.",
|
LOG->UserLog( "Song file", out.GetSongDir(), "has an invalid BPM change at beat %f, BPM %d.",
|
||||||
fBeat, iVal );
|
fBeat, iVal );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -846,13 +840,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %f",
|
LOG->UserLog( "Song file", out.GetSongDir(), "has an invalid BPM change at beat %f, BPM %f",
|
||||||
fBeat, fBPM );
|
fBeat, fBPM );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
LOG->UserLog( "Song file", out.GetSongDir(), "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -873,7 +867,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
LOG->UserLog( "Song file", out.GetSongDir(), "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -903,13 +897,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %f.",
|
LOG->UserLog( "Song file", out.GetSongDir(), "has an invalid BPM change at beat %f, BPM %f.",
|
||||||
NoteRowToBeat(iStepIndex), fBPM );
|
NoteRowToBeat(iStepIndex), fBPM );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Song file", m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
LOG->UserLog( "Song file", out.GetSongDir(), "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -951,13 +945,18 @@ static void SlideDuplicateDifficulties( Song &p )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BMSLoader::GetApplicableFiles( const RString &sPath, vector<RString> &out )
|
||||||
|
{
|
||||||
|
GetDirListing( sPath + RString("*.bms"), out );
|
||||||
|
GetDirListing( sPath + RString("*.bme"), out );
|
||||||
|
}
|
||||||
|
|
||||||
bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||||
{
|
{
|
||||||
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.c_str() );
|
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.c_str() );
|
||||||
|
|
||||||
ASSERT( out.m_vsKeysoundFile.empty() );
|
ASSERT( out.m_vsKeysoundFile.empty() );
|
||||||
|
|
||||||
m_sDir = sDir;
|
|
||||||
vector<RString> arrayBMSFileNames;
|
vector<RString> arrayBMSFileNames;
|
||||||
GetApplicableFiles( sDir, arrayBMSFileNames );
|
GetApplicableFiles( sDir, arrayBMSFileNames );
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class BMSLoader: public NotesLoader
|
|||||||
{
|
{
|
||||||
bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameToData, Steps &out1, const MeasureToTimeSig_t &sigAdjustments );
|
bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameToData, Steps &out1, const MeasureToTimeSig_t &sigAdjustments );
|
||||||
void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, MeasureToTimeSig_t &sigAdjustmentsOut );
|
void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, MeasureToTimeSig_t &sigAdjustmentsOut );
|
||||||
RString m_sDir;
|
|
||||||
map<RString,int> m_mapWavIdToKeysoundIndex;
|
map<RString,int> m_mapWavIdToKeysoundIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user