From 8d1a19a6f4aedc442740b4b0b198faa7021247ad Mon Sep 17 00:00:00 2001 From: psi29a Date: Sun, 6 Aug 2023 16:05:59 +0000 Subject: [PATCH] [#7358] Make MyGui 3.4.2 required for 0.49 --- .gitlab-ci.yml | 4 ++-- CI/before_install.osx.sh | 2 +- CI/before_script.msvc.sh | 20 ++++++++-------- CI/org.openmw.OpenMW.devel.yaml | 4 ++-- CMakeLists.txt | 18 +++------------ apps/openmw/CMakeLists.txt | 1 - apps/openmw/mwgui/bookpage.cpp | 4 ---- .../myguiplatform/myguirendermanager.hpp | 23 +++++++++++++++---- components/widgets/box.cpp | 20 ---------------- components/widgets/box.hpp | 8 ------- components/widgets/widgets.cpp | 1 - 11 files changed, 36 insertions(+), 69 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf4d6285ad..6201785e8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -187,7 +187,7 @@ Teal: Ubuntu_GCC_Debug: extends: .Ubuntu cache: - key: Ubuntu_GCC_Debug.ubuntu_22.04.v1 + key: Ubuntu_GCC_Debug.ubuntu_22.04.v2 before_script: - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic variables: @@ -512,7 +512,7 @@ macOS13_Xcode14_arm64: tags: - saas-macos-medium-m1 cache: - key: macOS12_Xcode14_arm64.v1 + key: macOS12_Xcode14_arm64.v4 variables: CCACHE_SIZE: 3G diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 68569039b1..f3320e97a0 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -32,7 +32,7 @@ qmake --version if [[ "${MACOS_AMD64}" ]]; then curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20221113.zip -o ~/openmw-deps.zip else - curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20230223_arm64.zip -o ~/openmw-deps.zip + curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20230722_arm64.zip -o ~/openmw-deps.zip fi unzip -o ~/openmw-deps.zip -d /tmp > /dev/null diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index a1af220e8a..551faaf547 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -607,14 +607,14 @@ if [ -z $SKIP_DOWNLOAD ]; then "ffmpeg-${FFMPEG_VER}-dev-win${BITS}.zip" # MyGUI - download "MyGUI 3.4.1" \ - "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}.7z" \ - "MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}.7z" + download "MyGUI 3.4.2" \ + "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}.7z" \ + "MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}.7z" if [ -n "$PDBS" ]; then download "MyGUI symbols" \ - "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}-sym.7z" \ - "MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}-sym.7z" + "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}-sym.7z" \ + "MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}-sym.7z" fi # OpenAL @@ -778,20 +778,20 @@ printf "FFmpeg ${FFMPEG_VER}... " } cd $DEPS echo -printf "MyGUI 3.4.1... " +printf "MyGUI 3.4.2... " { cd $DEPS_INSTALL if [ -d MyGUI ] && \ grep "MYGUI_VERSION_MAJOR 3" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \ grep "MYGUI_VERSION_MINOR 4" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \ - grep "MYGUI_VERSION_PATCH 1" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null + grep "MYGUI_VERSION_PATCH 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null then printf "Exists. " elif [ -z $SKIP_EXTRACT ]; then rm -rf MyGUI - eval 7z x -y "${DEPS}/MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}.7z" $STRIP - [ -n "$PDBS" ] && eval 7z x -y "${DEPS}/MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}-sym.7z" $STRIP - mv "MyGUI-3.4.1-msvc${MYGUI_MSVC_YEAR}-win${BITS}" MyGUI + eval 7z x -y "${DEPS}/MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}.7z" $STRIP + [ -n "$PDBS" ] && eval 7z x -y "${DEPS}/MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}-sym.7z" $STRIP + mv "MyGUI-3.4.2-msvc${MYGUI_MSVC_YEAR}-win${BITS}" MyGUI fi export MYGUI_HOME="$(real_pwd)/MyGUI" for CONFIGURATION in ${CONFIGURATIONS[@]}; do diff --git a/CI/org.openmw.OpenMW.devel.yaml b/CI/org.openmw.OpenMW.devel.yaml index 39889168ca..9e8fb9eeb9 100644 --- a/CI/org.openmw.OpenMW.devel.yaml +++ b/CI/org.openmw.OpenMW.devel.yaml @@ -125,8 +125,8 @@ modules: - "-DMYGUI_BUILD_PLUGINS=0" sources: - type: archive - url: https://github.com/MyGUI/mygui/archive/refs/tags/MyGUI3.4.1.tar.gz - sha256: bdf730bdeb4ad89e6b8223967db01aa5274d2b93adc2c0d6aa4842faeed4de1a + url: https://github.com/MyGUI/mygui/archive/refs/tags/MyGUI3.4.2.tar.gz + sha256: 1cc45fb96c9438e3476778449af0378443d84794a458978a29c75306e45dd45a - name: libunshield buildsystem: cmake-ninja diff --git a/CMakeLists.txt b/CMakeLists.txt index db8e946909..d9865e6569 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,7 +333,7 @@ endif() # Required for building the FFmpeg headers add_definitions(-D__STDC_CONSTANT_MACROS) -# Reqiuired for unity build +# Required for unity build add_definitions(-DMYGUI_DONT_REPLACE_NULLPTR) # TinyXML @@ -456,7 +456,7 @@ if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.77.0) endif() if(OPENMW_USE_SYSTEM_MYGUI) - find_package(MyGUI 3.4.1 REQUIRED) + find_package(MyGUI 3.4.2 REQUIRED) endif() find_package(SDL2 2.0.9 REQUIRED) find_package(OpenAL REQUIRED) @@ -709,18 +709,6 @@ if (WIN32) 5054 # Deprecated operations between enumerations of different types caused by Qt headers ) - if( "${MyGUI_VERSION}" VERSION_LESS_EQUAL "3.4.0" ) - set(WARNINGS_DISABLE ${WARNINGS_DISABLE} - 4866 # compiler may not enforce left-to-right evaluation order for call - ) - endif() - - if( "${MyGUI_VERSION}" VERSION_LESS_EQUAL "3.4.1" ) - set(WARNINGS_DISABLE ${WARNINGS_DISABLE} - 4275 # non dll-interface class 'MyGUI::delegates::IDelegateUnlink' used as base for dll-interface class 'MyGUI::Widget' - ) - endif() - foreach(d ${WARNINGS_DISABLE}) set(WARNINGS "${WARNINGS} /wd${d}") endforeach(d) @@ -791,7 +779,7 @@ if (WIN32) #set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") endif() -if (BUILD_OPENMW AND APPLE) +if (APPLE) target_compile_definitions(components PRIVATE GL_SILENCE_DEPRECATION=1) target_compile_definitions(openmw PRIVATE GL_SILENCE_DEPRECATION=1) endif() diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 44561446df..15c3fc0c38 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -219,7 +219,6 @@ if(APPLE) target_link_libraries(openmw ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK}) if (FFmpeg_FOUND) - target_link_libraries(openmw z) target_link_options(openmw PRIVATE "LINKER:SHELL:-framework CoreVideo" "LINKER:SHELL:-framework CoreMedia" "LINKER:SHELL:-framework VideoToolbox" diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index 32bd524305..5d9256b20d 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -769,11 +769,7 @@ namespace MWGui void reset(float left, float top, MyGUI::Colour colour) { -#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3, 4, 1) - mC = MyGUI::texture_utility::toColourARGB(colour) | 0xFF000000; -#else mC = MyGUI::texture_utility::toNativeColour(colour, MyGUI::VertexColourType::ColourARGB) | 0xFF000000; -#endif MyGUI::texture_utility::convertColour(mC, mVertexColourType); mCursor.left = mOrigin.left + left; diff --git a/components/myguiplatform/myguirendermanager.hpp b/components/myguiplatform/myguirendermanager.hpp index ed8d95e378..9a53b06c06 100644 --- a/components/myguiplatform/myguirendermanager.hpp +++ b/components/myguiplatform/myguirendermanager.hpp @@ -74,11 +74,23 @@ namespace osgMyGUI return static_cast(MyGUI::RenderManager::getInstancePtr()); } + bool checkTexture(MyGUI::ITexture* _texture) +#if MYGUI_DEBUG_MODE == 1 /* needed workaround for MyGUI 3.4.2 */ + override +#endif + ; + /** @see RenderManager::getViewSize */ - const MyGUI::IntSize& getViewSize() const override { return mViewSize; } + const MyGUI::IntSize& getViewSize() const override + { + return mViewSize; + } /** @see RenderManager::getVertexFormat */ - MyGUI::VertexColourType getVertexFormat() const override { return mVertexFormat; } + MyGUI::VertexColourType getVertexFormat() const override + { + return mVertexFormat; + } /** @see RenderManager::isFormatSupported */ bool isFormatSupported(MyGUI::PixelFormat format, MyGUI::TextureUsage usage) override; @@ -111,9 +123,10 @@ namespace osgMyGUI void setInjectState(osg::StateSet* stateSet); /** @see IRenderTarget::getInfo */ - const MyGUI::RenderTargetInfo& getInfo() const override { return mInfo; } - - bool checkTexture(MyGUI::ITexture* _texture); + const MyGUI::RenderTargetInfo& getInfo() const override + { + return mInfo; + } void setViewSize(int width, int height) override; diff --git a/components/widgets/box.cpp b/components/widgets/box.cpp index 4ef2e94d48..642721b807 100644 --- a/components/widgets/box.cpp +++ b/components/widgets/box.cpp @@ -1,29 +1,9 @@ #include "box.hpp" #include -#include namespace Gui { - // TODO: Since 3.4.2 MyGUI is supposed to automatically translate tags - // If the 3.4.2 become a required minimum version, the ComboBox class may be removed. - void ComboBox::setPropertyOverride(const std::string& _key, const std::string& _value) - { -#if MYGUI_VERSION >= MYGUI_DEFINE_VERSION(3, 4, 2) - MyGUI::ComboBox::setPropertyOverride(_key, _value); -#else - if (_key == "AddItem") - { - const std::string value = MyGUI::LanguageManager::getInstance().replaceTags(_value); - MyGUI::ComboBox::setPropertyOverride(_key, value); - } - else - { - MyGUI::ComboBox::setPropertyOverride(_key, _value); - } -#endif - } - void AutoSizedWidget::notifySizeChange(MyGUI::Widget* w) { MyGUI::Widget* parent = w->getParent(); diff --git a/components/widgets/box.hpp b/components/widgets/box.hpp index c004033eed..b5fcc8e9b6 100644 --- a/components/widgets/box.hpp +++ b/components/widgets/box.hpp @@ -11,14 +11,6 @@ namespace Gui { - class ComboBox : public FontWrapper - { - MYGUI_RTTI_DERIVED(ComboBox) - - protected: - void setPropertyOverride(const std::string& _key, const std::string& _value) override; - }; - class Button : public FontWrapper { MYGUI_RTTI_DERIVED(Button) diff --git a/components/widgets/widgets.cpp b/components/widgets/widgets.cpp index 8a7ebd9ccb..d27d7e5fc9 100644 --- a/components/widgets/widgets.cpp +++ b/components/widgets/widgets.cpp @@ -28,7 +28,6 @@ namespace Gui MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); - MyGUI::FactoryManager::getInstance().registerFactory("Widget"); } }