Another file search fix

pull/21/head
Michael Papageorgiou 13 years ago
parent 877cb2aca7
commit b2c6d52db1

@ -293,7 +293,7 @@ namespace MWSound
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())
{
streamMusicFull(filePath);

@ -89,12 +89,12 @@ namespace Files
}
// 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("");
if (sectionName == "")
{
return FileListLocator(mPriorityList, boost::filesystem::path(item), strict, false);
return FileListLocator(mPriorityList, boost::filesystem::path(item), strict, ignoreExtensions);
}
else
{
@ -103,7 +103,7 @@ namespace Files
std::cout << "Warning: There is no section named " << sectionName << "\n";
return result;
}
result = FileListLocator(mMap[sectionName], boost::filesystem::path(item), strict, false);
result = FileListLocator(mMap[sectionName], boost::filesystem::path(item), strict, ignoreExtensions);
}
return result;
}

@ -39,7 +39,7 @@ namespace Files
/// Optionally you can provide a specific section
/// The result is the first that comes up according to alphabetical
/// 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
void printSections();

Loading…
Cancel
Save