diff --git a/components/myguiplatform/myguidatamanager.cpp b/components/myguiplatform/myguidatamanager.cpp index 5e66a59965..80b7a096bc 100644 --- a/components/myguiplatform/myguidatamanager.cpp +++ b/components/myguiplatform/myguidatamanager.cpp @@ -31,8 +31,9 @@ void DataManager::setResourcePath(const std::string &path) mResourcePath = path; } -DataManager::DataManager(const VFS::Manager* vfs) - : mVfs(vfs) +DataManager::DataManager(const std::string& resourcePath, const VFS::Manager* vfs) + : mResourcePath(resourcePath) + , mVfs(vfs) { } diff --git a/components/myguiplatform/myguidatamanager.hpp b/components/myguiplatform/myguidatamanager.hpp index 0763ac0043..000c3ca1dd 100644 --- a/components/myguiplatform/myguidatamanager.hpp +++ b/components/myguiplatform/myguidatamanager.hpp @@ -16,7 +16,7 @@ namespace osgMyGUI class DataManager : public MyGUI::DataManager { public: - DataManager(const VFS::Manager* vfs); + explicit DataManager(const std::string& path, const VFS::Manager* vfs); void setResourcePath(const std::string& path); diff --git a/components/myguiplatform/myguiplatform.cpp b/components/myguiplatform/myguiplatform.cpp index 54d7cb17d0..203de195f4 100644 --- a/components/myguiplatform/myguiplatform.cpp +++ b/components/myguiplatform/myguiplatform.cpp @@ -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) : mLogFacility(logName.empty() ? nullptr : std::make_unique(logName, false)) , mLogManager(std::make_unique()) - , mDataManager(std::make_unique(vfs)) + , mDataManager(std::make_unique(resourcePath, vfs)) , mRenderManager(std::make_unique(viewer, guiRoot, imageManager, uiScalingFactor)) { if (mLogFacility != nullptr) mLogManager->addLogSource(mLogFacility->getSource()); - mDataManager->setResourcePath(resourcePath); - mRenderManager->initialise(); }