Initialize all required osgMyGUI::DataManager members in constructor

check_span
elsid 2 years ago
parent 1c507125df
commit 6738722aa5
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -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)
{
}

@ -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);

@ -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<LogFacility>(logName, false))
, 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))
{
if (mLogFacility != nullptr)
mLogManager->addLogSource(mLogFacility->getSource());
mDataManager->setResourcePath(resourcePath);
mRenderManager->initialise();
}

Loading…
Cancel
Save