1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Remove all MyGUI version checks

This commit is contained in:
uramer 2021-12-16 19:22:07 +01:00
parent 94b2bde48a
commit 2bc81e47a6
6 changed files with 7 additions and 61 deletions

View File

@ -907,12 +907,6 @@ protected:
return {};
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.top -= mCroppedParent->getAbsoluteTop ();
pos.top += mViewTop;

View File

@ -93,19 +93,6 @@ void KeyboardNavigation::_unlinkWidget(MyGUI::Widget *widget)
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)
{
while (widget && widget->getParent())
@ -128,9 +115,6 @@ void KeyboardNavigation::onFrame()
if (focus == mCurrentFocus)
{
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
styleFocusedButton(mCurrentFocus);
#endif
return;
}
@ -143,19 +127,8 @@ void KeyboardNavigation::onFrame()
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;
}
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
styleFocusedButton(mCurrentFocus);
#endif
}
void KeyboardNavigation::setDefaultFocus(MyGUI::Widget *window, MyGUI::Widget *defaultFocus)

View File

@ -586,7 +586,6 @@ bool RenderManager::checkTexture(MyGUI::ITexture* _texture)
return true;
}
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
void RenderManager::registerShader(
const std::string& _shaderName,
const std::string& _vertexProgramFile,
@ -594,6 +593,5 @@ void RenderManager::registerShader(
{
MYGUI_PLATFORM_LOG(Warning, "osgMyGUI::RenderManager::registerShader is not implemented");
}
#endif
}

View File

@ -116,17 +116,9 @@ public:
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;
#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;
#endif
/*internal:*/

View File

@ -165,8 +165,6 @@ namespace osgMyGUI
return nullptr;
}
#if MYGUI_VERSION > MYGUI_DEFINE_VERSION(3, 4, 0)
void OSGTexture::setShader(const std::string& _shaderName)
{ Log(Debug::Warning) << "OSGTexture::setShader is not implemented"; }
#endif
}

View File

@ -5,12 +5,6 @@
#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
{
class Image;
@ -57,21 +51,18 @@ namespace osgMyGUI
void* lock(MyGUI::TextureUsage access) 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 getHeight() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mHeight; }
int getWidth() const override { return mWidth; }
int getHeight() const override { return mHeight; }
MyGUI::PixelFormat getFormat() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mFormat; }
MyGUI::TextureUsage getUsage() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mUsage; }
size_t getNumElemBytes() OPENMW_MYGUI_CONST_GETTER_3_4_1 override { return mNumElemBytes; }
MyGUI::PixelFormat getFormat() const override { return mFormat; }
MyGUI::TextureUsage getUsage() const override { return mUsage; }
size_t getNumElemBytes() const override { return mNumElemBytes; }
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;
#endif
void setShader(const std::string& _shaderName) override;
/*internal:*/
osg::Texture2D *getTexture() const { return mTexture.get(); }