mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-11 16:06:42 +00:00
Merge branch 'warnfix' into 'master'
Follow-up for MR 2112 See merge request OpenMW/openmw!2162
This commit is contained in:
commit
8da463926e
6 changed files with 18 additions and 15 deletions
|
@ -194,8 +194,8 @@ 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(), mScalingFactor);
|
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), resourceSystem->getVFS(), mScalingFactor);
|
||||||
mGuiPlatform->initialise(resourceSystem->getVFS(), "mygui", (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
|
mGuiPlatform->initialise("mygui", (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
|
||||||
|
|
||||||
mGui = new MyGUI::Gui;
|
mGui = new MyGUI::Gui;
|
||||||
mGui->initialise("");
|
mGui->initialise("");
|
||||||
|
|
|
@ -18,6 +18,11 @@ void DataManager::setResourcePath(const std::string &path)
|
||||||
mResourcePath = path;
|
mResourcePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DataManager::DataManager(const VFS::Manager* vfs)
|
||||||
|
: mVfs(vfs)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
MyGUI::IDataStream *DataManager::getData(const std::string &name) const
|
MyGUI::IDataStream *DataManager::getData(const std::string &name) const
|
||||||
{
|
{
|
||||||
// Note: MyGUI is supposed to read/free input steam itself,
|
// Note: MyGUI is supposed to read/free input steam itself,
|
||||||
|
@ -39,11 +44,6 @@ bool DataManager::isDataExist(const std::string &name) const
|
||||||
return mVfs->exists(mResourcePath + "/" + name);
|
return mVfs->exists(mResourcePath + "/" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataManager::setVfs(const VFS::Manager* vfs)
|
|
||||||
{
|
|
||||||
mVfs = vfs;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MyGUI::VectorString &DataManager::getDataListNames(const std::string &pattern) const
|
const MyGUI::VectorString &DataManager::getDataListNames(const std::string &pattern) const
|
||||||
{
|
{
|
||||||
throw std::runtime_error("DataManager::getDataListNames is not implemented - VFS is used");
|
throw std::runtime_error("DataManager::getDataListNames is not implemented - VFS is used");
|
||||||
|
|
|
@ -16,9 +16,9 @@ public:
|
||||||
void initialise() {}
|
void initialise() {}
|
||||||
void shutdown() {}
|
void shutdown() {}
|
||||||
|
|
||||||
void setResourcePath(const std::string& path);
|
DataManager(const VFS::Manager* vfs);
|
||||||
|
|
||||||
void setVfs(const VFS::Manager* vfs);
|
void setResourcePath(const std::string& path);
|
||||||
|
|
||||||
/** Get data stream from specified resource name.
|
/** Get data stream from specified resource name.
|
||||||
@param _name Resource name (usually file name).
|
@param _name Resource name (usually file name).
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::ImageManager *imageManager, float uiScalingFactor)
|
Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::ImageManager *imageManager, const VFS::Manager* vfs, float uiScalingFactor)
|
||||||
: mRenderManager(nullptr)
|
: mRenderManager(nullptr)
|
||||||
, mDataManager(nullptr)
|
, mDataManager(nullptr)
|
||||||
, mLogManager(nullptr)
|
, mLogManager(nullptr)
|
||||||
|
@ -15,7 +15,7 @@ Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::Ima
|
||||||
{
|
{
|
||||||
mLogManager = new MyGUI::LogManager();
|
mLogManager = new MyGUI::LogManager();
|
||||||
mRenderManager = new RenderManager(viewer, guiRoot, imageManager, uiScalingFactor);
|
mRenderManager = new RenderManager(viewer, guiRoot, imageManager, uiScalingFactor);
|
||||||
mDataManager = new DataManager();
|
mDataManager = new DataManager(vfs);
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform::~Platform()
|
Platform::~Platform()
|
||||||
|
@ -30,7 +30,7 @@ Platform::~Platform()
|
||||||
mLogFacility = nullptr;
|
mLogFacility = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::initialise(const VFS::Manager* vfs, const std::string &resourcePath, const std::string &_logName)
|
void Platform::initialise(const std::string &resourcePath, const std::string &_logName)
|
||||||
{
|
{
|
||||||
if (!_logName.empty() && !mLogFacility)
|
if (!_logName.empty() && !mLogFacility)
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,6 @@ void Platform::initialise(const VFS::Manager* vfs, const std::string &resourcePa
|
||||||
}
|
}
|
||||||
|
|
||||||
mDataManager->setResourcePath(resourcePath);
|
mDataManager->setResourcePath(resourcePath);
|
||||||
mDataManager->setVfs(vfs);
|
|
||||||
|
|
||||||
mRenderManager->initialise();
|
mRenderManager->initialise();
|
||||||
mDataManager->initialise();
|
mDataManager->initialise();
|
||||||
|
|
|
@ -32,11 +32,11 @@ namespace osgMyGUI
|
||||||
class Platform
|
class Platform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager, float uiScalingFactor);
|
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager, const VFS::Manager* vfs, float uiScalingFactor);
|
||||||
|
|
||||||
~Platform();
|
~Platform();
|
||||||
|
|
||||||
void initialise(const VFS::Manager* vfs, const std::string& resourcePath, const std::string& _logName = "MyGUI.log");
|
void initialise(const std::string& resourcePath, const std::string& _logName = "MyGUI.log");
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,8 @@ add_subdirectory(shaders)
|
||||||
add_subdirectory(data)
|
add_subdirectory(data)
|
||||||
add_subdirectory(lua_api)
|
add_subdirectory(lua_api)
|
||||||
|
|
||||||
|
if (NOT DEFINED OPENMW_RESOURCES_ROOT)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
copy_resource_file("launcher/images/openmw.png" "${OPENMW_RESOURCES_ROOT}" "resources/openmw.png")
|
copy_resource_file("launcher/images/openmw.png" "${OPENMW_RESOURCES_ROOT}" "resources/openmw.png")
|
||||||
|
|
Loading…
Reference in a new issue