From 75e1089900ec3bb923337ea5c3420fe33281fdbc Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 14 Feb 2007 11:43:24 +0000 Subject: [PATCH] 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? --- stepmania/src/NotesLoaderBMS.cpp | 29 ++++++++++++++--------------- stepmania/src/NotesLoaderBMS.h | 1 - 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index 9e41871a2a..dd33234a25 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -715,12 +715,6 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa return true; } -void BMSLoader::GetApplicableFiles( const RString &sPath, vector &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 &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 arrayBMSFileNames; GetApplicableFiles( sDir, arrayBMSFileNames ); diff --git a/stepmania/src/NotesLoaderBMS.h b/stepmania/src/NotesLoaderBMS.h index a2f1604c61..f60227d7ec 100644 --- a/stepmania/src/NotesLoaderBMS.h +++ b/stepmania/src/NotesLoaderBMS.h @@ -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 m_mapWavIdToKeysoundIndex; public: