|
|
|
@ -240,15 +240,12 @@ OMW::Engine::~Engine()
|
|
|
|
|
|
|
|
|
|
void OMW::Engine::loadBSA()
|
|
|
|
|
{
|
|
|
|
|
boost::filesystem::directory_iterator end;
|
|
|
|
|
const Files::MultiDirCollection& bsa = mFileCollections.getCollection (".bsa");
|
|
|
|
|
|
|
|
|
|
for (boost::filesystem::directory_iterator iter (mDataDir); iter!=end; ++iter)
|
|
|
|
|
for (Files::MultiDirCollection::TIter iter (bsa.begin()); iter!=bsa.end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
if (boost::filesystem::extension (iter->path())==".bsa")
|
|
|
|
|
{
|
|
|
|
|
std::cout << "Adding " << iter->path().string() << std::endl;
|
|
|
|
|
addBSA(iter->path().string());
|
|
|
|
|
}
|
|
|
|
|
std::cout << "Adding " << iter->second.string() << std::endl;
|
|
|
|
|
addBSA (iter->second.string());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -263,9 +260,13 @@ void OMW::Engine::addResourcesDirectory (const boost::filesystem::path& path)
|
|
|
|
|
|
|
|
|
|
// Set data dir
|
|
|
|
|
|
|
|
|
|
void OMW::Engine::setDataDir (const boost::filesystem::path& dataDir)
|
|
|
|
|
void OMW::Engine::setDataDirs (const std::vector<boost::filesystem::path>& dataDirs)
|
|
|
|
|
{
|
|
|
|
|
mDataDir = boost::filesystem::system_complete (dataDir);
|
|
|
|
|
/// \todo remove mDataDir, once resources system can handle multiple directories
|
|
|
|
|
assert (!dataDirs.empty());
|
|
|
|
|
mDataDir = dataDirs[0];
|
|
|
|
|
|
|
|
|
|
mFileCollections = Files::Collections (dataDirs, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set resource dir
|
|
|
|
@ -318,15 +319,12 @@ void OMW::Engine::setNewGame()
|
|
|
|
|
void OMW::Engine::go()
|
|
|
|
|
{
|
|
|
|
|
assert (!mEnvironment.mWorld);
|
|
|
|
|
assert (!mDataDir.empty());
|
|
|
|
|
assert (!mCellName.empty());
|
|
|
|
|
assert (!mMaster.empty());
|
|
|
|
|
|
|
|
|
|
test.name = "";
|
|
|
|
|
total = 0;
|
|
|
|
|
|
|
|
|
|
std::cout << "Data directory: " << mDataDir << "\n";
|
|
|
|
|
|
|
|
|
|
std::string cfgDir = Files::getPath (Files::Path_ConfigGlobal, "openmw", "");
|
|
|
|
|
std::string cfgUserDir = Files::getPath (Files::Path_ConfigUser, "openmw", "");
|
|
|
|
|
std::string plugCfg = "plugins.cfg";
|
|
|
|
@ -358,8 +356,8 @@ void OMW::Engine::go()
|
|
|
|
|
mPhysicEngine = new OEngine::Physic::PhysicEngine(shapeLoader);
|
|
|
|
|
|
|
|
|
|
// Create the world
|
|
|
|
|
mEnvironment.mWorld = new MWWorld::World (mOgre, mPhysicEngine, mDataDir, mMaster, mResDir, mNewGame, mEnvironment);
|
|
|
|
|
|
|
|
|
|
mEnvironment.mWorld = new MWWorld::World (mOgre, mPhysicEngine, mFileCollections, mMaster,
|
|
|
|
|
mResDir, mNewGame, mEnvironment);
|
|
|
|
|
|
|
|
|
|
// Set up the GUI system
|
|
|
|
|
mGuiManager = new OEngine::GUI::MyGUIManager(mOgre.getWindow(), mOgre.getScene(), false, cfgDir);
|
|
|
|
|