mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 03:45:35 +00:00
Merge branch 'require-3.4-mygui' into 'master'
Raise required MyGUI version to 3.4.1 See merge request OpenMW/openmw!1484
This commit is contained in:
commit
2f7b98cecb
11 changed files with 21 additions and 94 deletions
|
@ -399,7 +399,7 @@ set(Boost_NO_BOOST_CMAKE ON)
|
||||||
|
|
||||||
find_package(Boost 1.6.2 REQUIRED COMPONENTS ${BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS})
|
find_package(Boost 1.6.2 REQUIRED COMPONENTS ${BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS})
|
||||||
if(OPENMW_USE_SYSTEM_MYGUI)
|
if(OPENMW_USE_SYSTEM_MYGUI)
|
||||||
find_package(MyGUI 3.2.2 REQUIRED)
|
find_package(MyGUI 3.4.1 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
find_package(SDL2 2.0.9 REQUIRED)
|
find_package(SDL2 2.0.9 REQUIRED)
|
||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
|
|
|
@ -907,12 +907,6 @@ protected:
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
MyGUI::IntPoint pos (left, top);
|
MyGUI::IntPoint pos (left, top);
|
||||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
|
||||||
// work around inconsistency in MyGUI where the mouse press coordinates aren't
|
|
||||||
// transformed by the current Layer (even though mouse *move* events are).
|
|
||||||
if(!move)
|
|
||||||
pos = mNode->getLayer()->getPosition(left, top);
|
|
||||||
#endif
|
|
||||||
pos.left -= mCroppedParent->getAbsoluteLeft ();
|
pos.left -= mCroppedParent->getAbsoluteLeft ();
|
||||||
pos.top -= mCroppedParent->getAbsoluteTop ();
|
pos.top -= mCroppedParent->getAbsoluteTop ();
|
||||||
pos.top += mViewTop;
|
pos.top += mViewTop;
|
||||||
|
|
|
@ -93,19 +93,6 @@ void KeyboardNavigation::_unlinkWidget(MyGUI::Widget *widget)
|
||||||
mCurrentFocus = nullptr;
|
mCurrentFocus = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
|
||||||
void styleFocusedButton(MyGUI::Widget* w)
|
|
||||||
{
|
|
||||||
if (w)
|
|
||||||
{
|
|
||||||
if (MyGUI::Button* b = w->castType<MyGUI::Button>(false))
|
|
||||||
{
|
|
||||||
b->_setWidgetState("highlighted");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool isRootParent(MyGUI::Widget* widget, MyGUI::Widget* root)
|
bool isRootParent(MyGUI::Widget* widget, MyGUI::Widget* root)
|
||||||
{
|
{
|
||||||
while (widget && widget->getParent())
|
while (widget && widget->getParent())
|
||||||
|
@ -128,9 +115,6 @@ void KeyboardNavigation::onFrame()
|
||||||
|
|
||||||
if (focus == mCurrentFocus)
|
if (focus == mCurrentFocus)
|
||||||
{
|
{
|
||||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
|
||||||
styleFocusedButton(mCurrentFocus);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,19 +127,8 @@ void KeyboardNavigation::onFrame()
|
||||||
|
|
||||||
if (focus != mCurrentFocus)
|
if (focus != mCurrentFocus)
|
||||||
{
|
{
|
||||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
|
||||||
if (mCurrentFocus)
|
|
||||||
{
|
|
||||||
if (MyGUI::Button* b = mCurrentFocus->castType<MyGUI::Button>(false))
|
|
||||||
b->_setWidgetState("normal");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
mCurrentFocus = focus;
|
mCurrentFocus = focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
|
||||||
styleFocusedButton(mCurrentFocus);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardNavigation::setDefaultFocus(MyGUI::Widget *window, MyGUI::Widget *defaultFocus)
|
void KeyboardNavigation::setDefaultFocus(MyGUI::Widget *window, MyGUI::Widget *defaultFocus)
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUICOMPAT_H
|
|
||||||
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUICOMPAT_H
|
|
||||||
|
|
||||||
#include <MyGUI_Prerequest.h>
|
|
||||||
|
|
||||||
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
#define OPENMW_MYGUI_CONST_GETTER_3_4_1 const
|
|
||||||
#else
|
|
||||||
#define OPENMW_MYGUI_CONST_GETTER_3_4_1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUICOMPAT_H
|
|
|
@ -15,7 +15,7 @@ void DataManager::setResourcePath(const std::string &path)
|
||||||
mResourcePath = path;
|
mResourcePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGUI::IDataStream *DataManager::getData(const std::string &name) OPENMW_MYGUI_CONST_GETTER_3_4_1
|
MyGUI::IDataStream *DataManager::getData(const std::string &name) const
|
||||||
{
|
{
|
||||||
std::string fullpath = getDataPath(name);
|
std::string fullpath = getDataPath(name);
|
||||||
std::unique_ptr<boost::filesystem::ifstream> stream;
|
std::unique_ptr<boost::filesystem::ifstream> stream;
|
||||||
|
@ -34,13 +34,13 @@ void DataManager::freeData(MyGUI::IDataStream *data)
|
||||||
delete data;
|
delete data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DataManager::isDataExist(const std::string &name) OPENMW_MYGUI_CONST_GETTER_3_4_1
|
bool DataManager::isDataExist(const std::string &name) const
|
||||||
{
|
{
|
||||||
std::string fullpath = mResourcePath + "/" + name;
|
std::string fullpath = mResourcePath + "/" + name;
|
||||||
return boost::filesystem::exists(fullpath);
|
return boost::filesystem::exists(fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MyGUI::VectorString &DataManager::getDataListNames(const std::string &pattern) OPENMW_MYGUI_CONST_GETTER_3_4_1
|
const MyGUI::VectorString &DataManager::getDataListNames(const std::string &pattern) const
|
||||||
{
|
{
|
||||||
// TODO: pattern matching (unused?)
|
// TODO: pattern matching (unused?)
|
||||||
static MyGUI::VectorString strings;
|
static MyGUI::VectorString strings;
|
||||||
|
@ -49,7 +49,7 @@ const MyGUI::VectorString &DataManager::getDataListNames(const std::string &patt
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &DataManager::getDataPath(const std::string &name) OPENMW_MYGUI_CONST_GETTER_3_4_1
|
const std::string &DataManager::getDataPath(const std::string &name) const
|
||||||
{
|
{
|
||||||
static std::string result;
|
static std::string result;
|
||||||
result.clear();
|
result.clear();
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
#include <MyGUI_DataManager.h>
|
#include <MyGUI_DataManager.h>
|
||||||
|
|
||||||
#include "myguicompat.h"
|
|
||||||
|
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -19,7 +17,7 @@ public:
|
||||||
/** 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).
|
||||||
*/
|
*/
|
||||||
MyGUI::IDataStream* getData(const std::string& _name) OPENMW_MYGUI_CONST_GETTER_3_4_1 override;
|
MyGUI::IDataStream* getData(const std::string& _name) const override;
|
||||||
|
|
||||||
/** Free data stream.
|
/** Free data stream.
|
||||||
@param _data Data stream.
|
@param _data Data stream.
|
||||||
|
@ -29,18 +27,18 @@ public:
|
||||||
/** Is data with specified name exist.
|
/** Is data with specified name exist.
|
||||||
@param _name Resource name.
|
@param _name Resource name.
|
||||||
*/
|
*/
|
||||||
bool isDataExist(const std::string& _name) OPENMW_MYGUI_CONST_GETTER_3_4_1 override;
|
bool isDataExist(const std::string& _name) const override;
|
||||||
|
|
||||||
/** Get all data names with names that matches pattern.
|
/** Get all data names with names that matches pattern.
|
||||||
@param _pattern Pattern to match (for example "*.layout").
|
@param _pattern Pattern to match (for example "*.layout").
|
||||||
*/
|
*/
|
||||||
const MyGUI::VectorString& getDataListNames(const std::string& _pattern) OPENMW_MYGUI_CONST_GETTER_3_4_1 override;
|
const MyGUI::VectorString& getDataListNames(const std::string& _pattern) const override;
|
||||||
|
|
||||||
/** Get full path to data.
|
/** Get full path to data.
|
||||||
@param _name Resource name.
|
@param _name Resource name.
|
||||||
@return Return full path to specified data.
|
@return Return full path to specified data.
|
||||||
*/
|
*/
|
||||||
const std::string& getDataPath(const std::string& _name) OPENMW_MYGUI_CONST_GETTER_3_4_1 override;
|
const std::string& getDataPath(const std::string& _name) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mResourcePath;
|
std::string mResourcePath;
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <components/shader/shadermanager.hpp>
|
#include <components/shader/shadermanager.hpp>
|
||||||
#include <components/sceneutil/nodecallback.hpp>
|
#include <components/sceneutil/nodecallback.hpp>
|
||||||
|
|
||||||
#include "myguicompat.h"
|
|
||||||
#include "myguitexture.hpp"
|
#include "myguitexture.hpp"
|
||||||
|
|
||||||
#define MYGUI_PLATFORM_LOG_SECTION "Platform"
|
#define MYGUI_PLATFORM_LOG_SECTION "Platform"
|
||||||
|
@ -276,7 +275,7 @@ public:
|
||||||
osg::VertexBufferObject* getVertexBuffer();
|
osg::VertexBufferObject* getVertexBuffer();
|
||||||
|
|
||||||
void setVertexCount(size_t count) override;
|
void setVertexCount(size_t count) override;
|
||||||
size_t getVertexCount() OPENMW_MYGUI_CONST_GETTER_3_4_1 override;
|
size_t getVertexCount() const override;
|
||||||
|
|
||||||
MyGUI::Vertex *lock() override;
|
MyGUI::Vertex *lock() override;
|
||||||
void unlock() override;
|
void unlock() override;
|
||||||
|
@ -303,7 +302,7 @@ void OSGVertexBuffer::setVertexCount(size_t count)
|
||||||
mNeedVertexCount = count;
|
mNeedVertexCount = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t OSGVertexBuffer::getVertexCount() OPENMW_MYGUI_CONST_GETTER_3_4_1
|
size_t OSGVertexBuffer::getVertexCount() const
|
||||||
{
|
{
|
||||||
return mNeedVertexCount;
|
return mNeedVertexCount;
|
||||||
}
|
}
|
||||||
|
@ -586,7 +585,6 @@ bool RenderManager::checkTexture(MyGUI::ITexture* _texture)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
void RenderManager::registerShader(
|
void RenderManager::registerShader(
|
||||||
const std::string& _shaderName,
|
const std::string& _shaderName,
|
||||||
const std::string& _vertexProgramFile,
|
const std::string& _vertexProgramFile,
|
||||||
|
@ -594,6 +592,5 @@ void RenderManager::registerShader(
|
||||||
{
|
{
|
||||||
MYGUI_PLATFORM_LOG(Warning, "osgMyGUI::RenderManager::registerShader is not implemented");
|
MYGUI_PLATFORM_LOG(Warning, "osgMyGUI::RenderManager::registerShader is not implemented");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
#include "myguicompat.h"
|
|
||||||
|
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
class ImageManager;
|
class ImageManager;
|
||||||
|
@ -79,7 +77,7 @@ public:
|
||||||
const MyGUI::IntSize& getViewSize() const override { return mViewSize; }
|
const MyGUI::IntSize& getViewSize() const override { return mViewSize; }
|
||||||
|
|
||||||
/** @see RenderManager::getVertexFormat */
|
/** @see RenderManager::getVertexFormat */
|
||||||
MyGUI::VertexColourType getVertexFormat() OPENMW_MYGUI_CONST_GETTER_3_4_1 override
|
MyGUI::VertexColourType getVertexFormat() const override
|
||||||
{ return mVertexFormat; }
|
{ return mVertexFormat; }
|
||||||
|
|
||||||
/** @see RenderManager::isFormatSupported */
|
/** @see RenderManager::isFormatSupported */
|
||||||
|
@ -112,21 +110,13 @@ public:
|
||||||
void setInjectState(osg::StateSet* stateSet);
|
void setInjectState(osg::StateSet* stateSet);
|
||||||
|
|
||||||
/** @see IRenderTarget::getInfo */
|
/** @see IRenderTarget::getInfo */
|
||||||
const MyGUI::RenderTargetInfo& getInfo() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mInfo; }
|
const MyGUI::RenderTargetInfo& getInfo() const override { return mInfo; }
|
||||||
|
|
||||||
bool checkTexture(MyGUI::ITexture* _texture);
|
bool checkTexture(MyGUI::ITexture* _texture);
|
||||||
|
|
||||||
// setViewSize() is a part of MyGUI::RenderManager interface since 3.4.0 release
|
|
||||||
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
void setViewSize(int width, int height);
|
|
||||||
#else
|
|
||||||
void setViewSize(int width, int height) override;
|
void setViewSize(int width, int height) override;
|
||||||
#endif
|
|
||||||
|
|
||||||
// registerShader() is a part of MyGUI::RenderManager interface since 3.4.1 release
|
|
||||||
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
void registerShader(const std::string& _shaderName, const std::string& _vertexProgramFile, const std::string& _fragmentProgramFile) override;
|
void registerShader(const std::string& _shaderName, const std::string& _vertexProgramFile, const std::string& _fragmentProgramFile) override;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*internal:*/
|
/*internal:*/
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,6 @@ namespace osgMyGUI
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
void OSGTexture::setShader(const std::string& _shaderName)
|
void OSGTexture::setShader(const std::string& _shaderName)
|
||||||
{ Log(Debug::Warning) << "OSGTexture::setShader is not implemented"; }
|
{ Log(Debug::Warning) << "OSGTexture::setShader is not implemented"; }
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,6 @@
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
#define OPENMW_MYGUI_CONST_GETTER_3_4_1 const
|
|
||||||
#else
|
|
||||||
#define OPENMW_MYGUI_CONST_GETTER_3_4_1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace osg
|
namespace osg
|
||||||
{
|
{
|
||||||
class Image;
|
class Image;
|
||||||
|
@ -57,21 +51,18 @@ namespace osgMyGUI
|
||||||
|
|
||||||
void* lock(MyGUI::TextureUsage access) override;
|
void* lock(MyGUI::TextureUsage access) override;
|
||||||
void unlock() override;
|
void unlock() override;
|
||||||
bool isLocked() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mLockedImage.valid(); }
|
bool isLocked() const override { return mLockedImage.valid(); }
|
||||||
|
|
||||||
int getWidth() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mWidth; }
|
int getWidth() const override { return mWidth; }
|
||||||
int getHeight() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mHeight; }
|
int getHeight() const override { return mHeight; }
|
||||||
|
|
||||||
MyGUI::PixelFormat getFormat() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mFormat; }
|
MyGUI::PixelFormat getFormat() const override { return mFormat; }
|
||||||
MyGUI::TextureUsage getUsage() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mUsage; }
|
MyGUI::TextureUsage getUsage() const override { return mUsage; }
|
||||||
size_t getNumElemBytes() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mNumElemBytes; }
|
size_t getNumElemBytes() const override { return mNumElemBytes; }
|
||||||
|
|
||||||
MyGUI::IRenderTarget *getRenderTarget() override;
|
MyGUI::IRenderTarget *getRenderTarget() override;
|
||||||
|
|
||||||
// setShader() is a part of MyGUI::RenderManager interface since 3.4.1 release
|
|
||||||
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
|
|
||||||
void setShader(const std::string& _shaderName) override;
|
void setShader(const std::string& _shaderName) override;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*internal:*/
|
/*internal:*/
|
||||||
osg::Texture2D *getTexture() const { return mTexture.get(); }
|
osg::Texture2D *getTexture() const { return mTexture.get(); }
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
#include <MyGUI_RenderManager.h>
|
#include <MyGUI_RenderManager.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "myguicompat.h"
|
|
||||||
|
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -39,7 +37,7 @@ namespace osgMyGUI
|
||||||
mTarget->doRender(_buffer, _texture, _count);
|
mTarget->doRender(_buffer, _texture, _count);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MyGUI::RenderTargetInfo& getInfo() OPENMW_MYGUI_CONST_GETTER_3_4_1 override
|
const MyGUI::RenderTargetInfo& getInfo() const override
|
||||||
{
|
{
|
||||||
mInfo = mTarget->getInfo();
|
mInfo = mTarget->getInfo();
|
||||||
mInfo.hOffset = mHOffset;
|
mInfo.hOffset = mHOffset;
|
||||||
|
|
Loading…
Reference in a new issue