mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 16:06:44 +00:00
pull in all bsa files instead of only the bsa file matching the master
This commit is contained in:
parent
223d8ffd9b
commit
7e4f655939
2 changed files with 20 additions and 21 deletions
|
@ -18,30 +18,27 @@ OMW::Engine::Engine() {}
|
||||||
|
|
||||||
void OMW::Engine::prepareMaster()
|
void OMW::Engine::prepareMaster()
|
||||||
{
|
{
|
||||||
assert (!mDataDir.empty());
|
|
||||||
|
|
||||||
std::string masterName; // name without extension
|
|
||||||
|
|
||||||
std::string::size_type sep = mMaster.find_last_of (".");
|
std::string::size_type sep = mMaster.find_last_of (".");
|
||||||
|
|
||||||
if (sep==std::string::npos)
|
if (sep==std::string::npos)
|
||||||
{
|
{
|
||||||
masterName = mMaster;
|
|
||||||
mMaster += ".esm";
|
mMaster += ".esm";
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
masterName = mMaster.substr (0, sep);
|
|
||||||
}
|
|
||||||
|
|
||||||
// bsa
|
// Load all BSA files in data directory.
|
||||||
boost::filesystem::path bsa (mDataDir);
|
|
||||||
bsa /= masterName + ".bsa";
|
|
||||||
|
|
||||||
if (boost::filesystem::exists (bsa))
|
void OMW::Engine::loadBSA()
|
||||||
|
{
|
||||||
|
boost::filesystem::directory_iterator end;
|
||||||
|
|
||||||
|
for (boost::filesystem::directory_iterator iter (mDataDir); iter!=end; ++iter)
|
||||||
{
|
{
|
||||||
std::cout << "Adding " << bsa.string() << std::endl;
|
if (boost::filesystem::extension (iter->path())==".bsa")
|
||||||
addBSA(bsa.file_string());
|
{
|
||||||
|
std::cout << "Adding " << iter->path().string() << std::endl;
|
||||||
|
addBSA(iter->path().file_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +67,6 @@ void OMW::Engine::setCell (const std::string& cellName)
|
||||||
|
|
||||||
// Set master file (esm)
|
// Set master file (esm)
|
||||||
// - If the given name does not have an extension, ".esm" is added automatically
|
// - If the given name does not have an extension, ".esm" is added automatically
|
||||||
// - If there is a bsa file with the same name, OpenMW will load it.
|
|
||||||
// - Currently OpenMW only supports one master at the same time.
|
// - Currently OpenMW only supports one master at the same time.
|
||||||
|
|
||||||
void OMW::Engine::addMaster (const std::string& master)
|
void OMW::Engine::addMaster (const std::string& master)
|
||||||
|
@ -101,6 +97,7 @@ void OMW::Engine::go()
|
||||||
addResourcesDirectory (mDataDir / "Textures");
|
addResourcesDirectory (mDataDir / "Textures");
|
||||||
|
|
||||||
prepareMaster();
|
prepareMaster();
|
||||||
|
loadBSA();
|
||||||
|
|
||||||
boost::filesystem::path masterPath (mDataDir);
|
boost::filesystem::path masterPath (mDataDir);
|
||||||
masterPath /= mMaster;
|
masterPath /= mMaster;
|
||||||
|
|
|
@ -29,6 +29,9 @@ namespace OMW
|
||||||
/// \note This function works recursively.
|
/// \note This function works recursively.
|
||||||
void addResourcesDirectory (const boost::filesystem::path& path);
|
void addResourcesDirectory (const boost::filesystem::path& path);
|
||||||
|
|
||||||
|
/// Load all BSA files in data directory.
|
||||||
|
void loadBSA();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Engine();
|
Engine();
|
||||||
|
@ -41,7 +44,6 @@ namespace OMW
|
||||||
|
|
||||||
/// Set master file (esm)
|
/// Set master file (esm)
|
||||||
/// - If the given name does not have an extension, ".esm" is added automatically
|
/// - If the given name does not have an extension, ".esm" is added automatically
|
||||||
/// - If there is a bsa file with the same name, OpenMW will load it.
|
|
||||||
/// - Currently OpenMW only supports one master at the same time.
|
/// - Currently OpenMW only supports one master at the same time.
|
||||||
void addMaster (const std::string& master);
|
void addMaster (const std::string& master);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue