Another file search fix

actorid
Michael Papageorgiou 13 years ago
parent 877cb2aca7
commit b2c6d52db1

@ -293,7 +293,7 @@ namespace MWSound
void SoundManager::streamMusic(const std::string& filename) void SoundManager::streamMusic(const std::string& filename)
{ {
std::string filePath = mMusicLibrary.locate(filename, mFSStrict).string(); std::string filePath = mMusicLibrary.locate(filename, mFSStrict, true).string();
if(!filePath.empty()) if(!filePath.empty())
{ {
streamMusicFull(filePath); streamMusicFull(filePath);

@ -89,12 +89,12 @@ namespace Files
} }
// Searches the library for an item and returns a boost path to it // Searches the library for an item and returns a boost path to it
boost::filesystem::path FileLibrary::locate(std::string item, bool strict, std::string sectionName) boost::filesystem::path FileLibrary::locate(std::string item, bool strict, bool ignoreExtensions, std::string sectionName)
{ {
boost::filesystem::path result(""); boost::filesystem::path result("");
if (sectionName == "") if (sectionName == "")
{ {
return FileListLocator(mPriorityList, boost::filesystem::path(item), strict, false); return FileListLocator(mPriorityList, boost::filesystem::path(item), strict, ignoreExtensions);
} }
else else
{ {
@ -103,7 +103,7 @@ namespace Files
std::cout << "Warning: There is no section named " << sectionName << "\n"; std::cout << "Warning: There is no section named " << sectionName << "\n";
return result; return result;
} }
result = FileListLocator(mMap[sectionName], boost::filesystem::path(item), strict, false); result = FileListLocator(mMap[sectionName], boost::filesystem::path(item), strict, ignoreExtensions);
} }
return result; return result;
} }

@ -39,7 +39,7 @@ namespace Files
/// Optionally you can provide a specific section /// Optionally you can provide a specific section
/// The result is the first that comes up according to alphabetical /// The result is the first that comes up according to alphabetical
/// section naming /// section naming
boost::filesystem::path locate(std::string item, bool strict, std::string sectionName=""); boost::filesystem::path locate(std::string item, bool strict, bool ignoreExtensions, std::string sectionName="");
/// Prints all the available sections, used for debugging /// Prints all the available sections, used for debugging
void printSections(); void printSections();

Loading…
Cancel
Save