1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

Loose files should have priority over BSA resources. This makes texture replacers work.

This commit is contained in:
scrawl 2013-04-02 23:45:32 +02:00
parent ffb133c862
commit df0ee82a3c

View File

@ -153,20 +153,6 @@ OMW::Engine::~Engine()
void OMW::Engine::loadBSA()
{
for (std::vector<std::string>::const_iterator archive = mArchives.begin(); archive != mArchives.end(); ++archive)
{
if (mFileCollections.doesExist(*archive))
{
const std::string archivePath = mFileCollections.getPath(*archive).string();
std::cout << "Adding BSA archive " << archivePath << std::endl;
Bsa::addBSA(archivePath);
}
else
{
std::cout << "Archive " << *archive << " not found" << std::endl;
}
}
const Files::PathContainer& dataDirs = mFileCollections.getPaths();
std::string dataDirectory;
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
@ -175,6 +161,24 @@ void OMW::Engine::loadBSA()
std::cout << "Data dir " << dataDirectory << std::endl;
Bsa::addDir(dataDirectory, mFSStrict);
}
// BSA resources are put into a separate group. We want loose files to have priority over BSA resources, and this seems
// to be the only way to get Ogre to do just that.
Ogre::ResourceGroupManager::getSingleton ().createResourceGroup ("GroupBSA");
for (std::vector<std::string>::const_iterator archive = mArchives.begin(); archive != mArchives.end(); ++archive)
{
if (mFileCollections.doesExist(*archive))
{
const std::string archivePath = mFileCollections.getPath(*archive).string();
std::cout << "Adding BSA archive " << archivePath << std::endl;
Bsa::addBSA(archivePath, "GroupBSA");
}
else
{
std::cout << "Archive " << *archive << " not found" << std::endl;
}
}
}
// add resources directory