mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-23 02:41:34 +00:00
Remove redundant Platform::initialize function
This commit is contained in:
parent
c0e1642d7f
commit
a281bcaf90
3 changed files with 12 additions and 18 deletions
|
@ -194,8 +194,9 @@ namespace MWGui
|
||||||
, mWindowVisible(true)
|
, mWindowVisible(true)
|
||||||
{
|
{
|
||||||
mScalingFactor = std::clamp(Settings::Manager::getFloat("scaling factor", "GUI"), 0.5f, 8.f);
|
mScalingFactor = std::clamp(Settings::Manager::getFloat("scaling factor", "GUI"), 0.5f, 8.f);
|
||||||
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), resourceSystem->getVFS(), mScalingFactor);
|
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(),
|
||||||
mGuiPlatform->initialise("mygui", (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
|
resourceSystem->getVFS(), mScalingFactor, "mygui",
|
||||||
|
(std::filesystem::path(logpath) / "MyGUI.log").generic_string());
|
||||||
|
|
||||||
mGui = new MyGUI::Gui;
|
mGui = new MyGUI::Gui;
|
||||||
mGui->initialise("");
|
mGui->initialise("");
|
||||||
|
|
|
@ -7,24 +7,15 @@
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::ImageManager *imageManager,
|
Platform::Platform(osgViewer::Viewer *viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager,
|
||||||
const VFS::Manager* vfs, float uiScalingFactor)
|
const VFS::Manager* vfs, float uiScalingFactor, const std::string& resourcePath, const std::string& logName)
|
||||||
: mLogFacility(nullptr)
|
: 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>(vfs))
|
||||||
, mRenderManager(std::make_unique<RenderManager>(viewer, guiRoot, imageManager, uiScalingFactor))
|
, mRenderManager(std::make_unique<RenderManager>(viewer, guiRoot, imageManager, uiScalingFactor))
|
||||||
{
|
{
|
||||||
}
|
if (mLogFacility != nullptr)
|
||||||
|
|
||||||
Platform::~Platform() {}
|
|
||||||
|
|
||||||
void Platform::initialise(const std::string &resourcePath, const std::string &_logName)
|
|
||||||
{
|
|
||||||
if (!_logName.empty() && !mLogFacility)
|
|
||||||
{
|
|
||||||
mLogFacility = std::make_unique<LogFacility>(_logName, false);
|
|
||||||
mLogManager->addLogSource(mLogFacility->getSource());
|
mLogManager->addLogSource(mLogFacility->getSource());
|
||||||
}
|
|
||||||
|
|
||||||
mDataManager->setResourcePath(resourcePath);
|
mDataManager->setResourcePath(resourcePath);
|
||||||
|
|
||||||
|
@ -32,6 +23,8 @@ void Platform::initialise(const std::string &resourcePath, const std::string &_l
|
||||||
mDataManager->initialise();
|
mDataManager->initialise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Platform::~Platform() = default;
|
||||||
|
|
||||||
void Platform::shutdown()
|
void Platform::shutdown()
|
||||||
{
|
{
|
||||||
mRenderManager->shutdown();
|
mRenderManager->shutdown();
|
||||||
|
|
|
@ -33,12 +33,12 @@ namespace osgMyGUI
|
||||||
class Platform
|
class Platform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager, const VFS::Manager* vfs, float uiScalingFactor);
|
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager,
|
||||||
|
const VFS::Manager* vfs, float uiScalingFactor, const std::string& resourcePath,
|
||||||
|
const std::string& logName = "MyGUI.log");
|
||||||
|
|
||||||
~Platform();
|
~Platform();
|
||||||
|
|
||||||
void initialise(const std::string& resourcePath, const std::string& _logName = "MyGUI.log");
|
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
RenderManager* getRenderManagerPtr();
|
RenderManager* getRenderManagerPtr();
|
||||||
|
|
Loading…
Reference in a new issue