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:
Steve Checkoway
2007-02-14 11:43:24 +00:00
parent 41ef86d162
commit 75e1089900
2 changed files with 14 additions and 16 deletions
+14 -15
View File
@@ -715,12 +715,6 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa
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 )
{
RString sData;
@@ -743,7 +737,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
}
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 );
}
}
@@ -778,7 +772,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
}
}
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()
out.m_vsKeysoundFile.push_back( sData );
@@ -825,7 +819,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
}
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 );
}
break;
@@ -846,13 +840,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
}
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 );
}
}
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;
}
@@ -873,7 +867,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
}
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;
}
@@ -903,13 +897,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Me
}
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 );
}
}
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;
@@ -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 )
{
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.c_str() );
ASSERT( out.m_vsKeysoundFile.empty() );
m_sDir = sDir;
vector<RString> arrayBMSFileNames;
GetApplicableFiles( sDir, arrayBMSFileNames );
-1
View File
@@ -16,7 +16,6 @@ class BMSLoader: public NotesLoader
{
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 );
RString m_sDir;
map<RString,int> m_mapWavIdToKeysoundIndex;
public: