Merge branch 'warnfix' into 'master'

Follow-up for MR 2112

See merge request OpenMW/openmw!2162
LTO-timing^2
psi29a 3 years ago
commit 8da463926e

@ -194,8 +194,8 @@ namespace MWGui
, mWindowVisible(true)
{
mScalingFactor = std::clamp(Settings::Manager::getFloat("scaling factor", "GUI"), 0.5f, 8.f);
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), mScalingFactor);
mGuiPlatform->initialise(resourceSystem->getVFS(), "mygui", (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), resourceSystem->getVFS(), mScalingFactor);
mGuiPlatform->initialise("mygui", (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
mGui = new MyGUI::Gui;
mGui->initialise("");

@ -18,6 +18,11 @@ void DataManager::setResourcePath(const std::string &path)
mResourcePath = path;
}
DataManager::DataManager(const VFS::Manager* vfs)
: mVfs(vfs)
{
}
MyGUI::IDataStream *DataManager::getData(const std::string &name) const
{
// 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);
}
void DataManager::setVfs(const VFS::Manager* vfs)
{
mVfs = vfs;
}
const MyGUI::VectorString &DataManager::getDataListNames(const std::string &pattern) const
{
throw std::runtime_error("DataManager::getDataListNames is not implemented - VFS is used");

@ -16,9 +16,9 @@ public:
void initialise() {}
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.
@param _name Resource name (usually file name).

@ -7,7 +7,7 @@
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)
, mDataManager(nullptr)
, mLogManager(nullptr)
@ -15,7 +15,7 @@ Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::Ima
{
mLogManager = new MyGUI::LogManager();
mRenderManager = new RenderManager(viewer, guiRoot, imageManager, uiScalingFactor);
mDataManager = new DataManager();
mDataManager = new DataManager(vfs);
}
Platform::~Platform()
@ -30,7 +30,7 @@ Platform::~Platform()
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)
{
@ -39,7 +39,6 @@ void Platform::initialise(const VFS::Manager* vfs, const std::string &resourcePa
}
mDataManager->setResourcePath(resourcePath);
mDataManager->setVfs(vfs);
mRenderManager->initialise();
mDataManager->initialise();

@ -32,11 +32,11 @@ namespace osgMyGUI
class Platform
{
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();
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();

@ -2,4 +2,8 @@ add_subdirectory(shaders)
add_subdirectory(data)
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")

Loading…
Cancel
Save