1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-01 16:06:41 +00:00

Initialize all required osgMyGUI::DataManager members in constructor

This commit is contained in:
elsid 2022-07-18 20:54:00 +02:00
parent 1c507125df
commit 6738722aa5
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
3 changed files with 5 additions and 6 deletions

View file

@ -31,8 +31,9 @@ void DataManager::setResourcePath(const std::string &path)
mResourcePath = path; mResourcePath = path;
} }
DataManager::DataManager(const VFS::Manager* vfs) DataManager::DataManager(const std::string& resourcePath, const VFS::Manager* vfs)
: mVfs(vfs) : mResourcePath(resourcePath)
, mVfs(vfs)
{ {
} }

View file

@ -16,7 +16,7 @@ namespace osgMyGUI
class DataManager : public MyGUI::DataManager class DataManager : public MyGUI::DataManager
{ {
public: public:
DataManager(const VFS::Manager* vfs); explicit DataManager(const std::string& path, const VFS::Manager* vfs);
void setResourcePath(const std::string& path); void setResourcePath(const std::string& path);

View file

@ -11,14 +11,12 @@ Platform::Platform(osgViewer::Viewer *viewer, osg::Group* guiRoot, Resource::Ima
const VFS::Manager* vfs, float uiScalingFactor, const std::string& resourcePath, const std::string& logName) const VFS::Manager* vfs, float uiScalingFactor, const std::string& resourcePath, const std::string& logName)
: mLogFacility(logName.empty() ? nullptr : std::make_unique<LogFacility>(logName, false)) : mLogFacility(logName.empty() ? nullptr : std::make_unique<LogFacility>(logName, false))
, mLogManager(std::make_unique<MyGUI::LogManager>()) , mLogManager(std::make_unique<MyGUI::LogManager>())
, mDataManager(std::make_unique<DataManager>(vfs)) , mDataManager(std::make_unique<DataManager>(resourcePath, vfs))
, mRenderManager(std::make_unique<RenderManager>(viewer, guiRoot, imageManager, uiScalingFactor)) , mRenderManager(std::make_unique<RenderManager>(viewer, guiRoot, imageManager, uiScalingFactor))
{ {
if (mLogFacility != nullptr) if (mLogFacility != nullptr)
mLogManager->addLogSource(mLogFacility->getSource()); mLogManager->addLogSource(mLogFacility->getSource());
mDataManager->setResourcePath(resourcePath);
mRenderManager->initialise(); mRenderManager->initialise();
} }