osgMyGUI: move Platform methods to the .cpp file

openmw-37
scrawl 9 years ago
parent 7ff168b787
commit 51f3a8fec6

@ -33,6 +33,7 @@
#include <components/translation/translation.hpp>
#include <components/myguiplatform/myguiplatform.hpp>
#include <components/myguiplatform/myguirendermanager.hpp>
#include <components/vfs/manager.hpp>

@ -115,7 +115,7 @@ add_component_dir (loadinglistener
)
add_component_dir (myguiplatform
myguirendermanager myguidatamanager myguiplatform myguitexture myguiloglistener
myguirendermanager myguidatamanager myguiplatform myguitexture myguiloglistener additivelayer
)
add_component_dir (widgets

@ -1,2 +1,64 @@
#include "myguiplatform.hpp"
#include "myguirendermanager.hpp"
#include "myguidatamanager.hpp"
#include "myguiloglistener.hpp"
namespace osgMyGUI
{
Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::TextureManager *textureManager, float uiScalingFactor)
: mRenderManager(nullptr)
, mDataManager(nullptr)
, mLogManager(nullptr)
, mLogFacility(nullptr)
{
mLogManager = new MyGUI::LogManager();
mRenderManager = new RenderManager(viewer, guiRoot, textureManager, uiScalingFactor);
mDataManager = new DataManager();
}
Platform::~Platform()
{
delete mRenderManager;
mRenderManager = nullptr;
delete mDataManager;
mDataManager = nullptr;
delete mLogManager;
mLogManager = nullptr;
delete mLogFacility;
mLogFacility = nullptr;
}
void Platform::initialise(const std::string &resourcePath, const std::string &_logName)
{
if (!_logName.empty() && !mLogFacility)
{
mLogFacility = new LogFacility(_logName, false);
mLogManager->addLogSource(mLogFacility->getSource());
}
mDataManager->setResourcePath(resourcePath);
mRenderManager->initialise();
mDataManager->initialise();
}
void Platform::shutdown()
{
mRenderManager->shutdown();
mDataManager->shutdown();
}
RenderManager *Platform::getRenderManagerPtr()
{
return mRenderManager;
}
DataManager *Platform::getDataManagerPtr()
{
return mDataManager;
}
}

@ -1,71 +1,46 @@
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIPLATFORM_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIPLATFORM_H
#include "MyGUI_Prerequest.h"
#include "MyGUI_LogManager.h"
#include <string>
#include "myguirendermanager.hpp"
#include "myguidatamanager.hpp"
#include "myguiloglistener.hpp"
namespace osgViewer
{
class Viewer;
}
namespace osg
{
class Group;
}
namespace Resource
{
class TextureManager;
}
namespace MyGUI
{
class LogManager;
}
namespace osgMyGUI
{
class RenderManager;
class DataManager;
class LogFacility;
class Platform
{
public:
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager, float uiScalingFactor)
: mRenderManager(nullptr)
, mDataManager(nullptr)
, mLogManager(nullptr)
, mLogFacility(nullptr)
{
mLogManager = new MyGUI::LogManager();
mRenderManager = new RenderManager(viewer, guiRoot, textureManager, uiScalingFactor);
mDataManager = new DataManager();
}
~Platform()
{
delete mRenderManager;
mRenderManager = nullptr;
delete mDataManager;
mDataManager = nullptr;
delete mLogManager;
mLogManager = nullptr;
delete mLogFacility;
mLogFacility = nullptr;
}
void initialise(const std::string& resourcePath, const std::string& _logName = "MyGUI.log")
{
if (!_logName.empty() && !mLogFacility)
{
mLogFacility = new LogFacility(_logName, false);
mLogManager->addLogSource(mLogFacility->getSource());
}
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager, float uiScalingFactor);
mDataManager->setResourcePath(resourcePath);
~Platform();
mRenderManager->initialise();
mDataManager->initialise();
}
void initialise(const std::string& resourcePath, const std::string& _logName = "MyGUI.log");
void shutdown()
{
mRenderManager->shutdown();
mDataManager->shutdown();
}
void shutdown();
RenderManager* getRenderManagerPtr()
{
return mRenderManager;
}
RenderManager* getRenderManagerPtr();
DataManager* getDataManagerPtr()
{
return mDataManager;
}
DataManager* getDataManagerPtr();
private:
RenderManager* mRenderManager;

Loading…
Cancel
Save