]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Restore Irrlicht 1.9 support
authorsfan5 <sfan5@live.de>
Sat, 16 May 2020 23:03:33 +0000 (01:03 +0200)
committersfan5 <sfan5@live.de>
Tue, 9 Mar 2021 20:53:17 +0000 (21:53 +0100)
misc/Info.plist
src/client/render/interlaced.cpp
src/client/renderingengine.cpp
src/client/sky.cpp
src/gui/guiButton.cpp
src/gui/guiButton.h
src/irrlicht_changes/static_text.cpp
src/irrlicht_changes/static_text.h

index 1498ee474c0897d266f91065990b25d35a6fdb3d..0491d2fc11b582620355ed89c2c3626a35126840 100644 (file)
@@ -8,7 +8,13 @@
        <string>minetest</string>
        <key>CFBundleIconFile</key>
        <string>minetest-icon.icns</string>
+       <key>CFBundleName</key>
+       <string>Minetest</string>
+       <key>CFBundleDisplayName</key>
+       <string>Minetest</string>
        <key>CFBundleIdentifier</key>
        <string>net.minetest.minetest</string>
+       <key>NSHighResolutionCapable</key>
+       <false/>
 </dict>
 </plist>
index ce8e92f219c7a11cd47fb264cb353787cac58f2a..3f79a8eb57909bff21a34058b765ad1ef7fd9728 100644 (file)
@@ -35,7 +35,11 @@ void RenderingCoreInterlaced::initMaterial()
        IShaderSource *s = client->getShaderSource();
        mat.UseMipMaps = false;
        mat.ZBuffer = false;
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+       mat.ZWriteEnable = video::EZW_OFF;
+#else
        mat.ZWriteEnable = false;
+#endif
        u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC);
        mat.MaterialType = s->getShaderInfo(shader).material;
        for (int k = 0; k < 3; ++k) {
index 99ff8c1ee950ca242d254f9cff9772f753071c0e..055a555abe4c6c268ae86f1a1a80d61abd71ee95 100644 (file)
@@ -325,9 +325,11 @@ static bool getWindowHandle(irr::video::IVideoDriver *driver, HWND &hWnd)
        const video::SExposedVideoData exposedData = driver->getExposedVideoData();
 
        switch (driver->getDriverType()) {
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 9
        case video::EDT_DIRECT3D8:
                hWnd = reinterpret_cast<HWND>(exposedData.D3D8.HWnd);
                break;
+#endif
        case video::EDT_DIRECT3D9:
                hWnd = reinterpret_cast<HWND>(exposedData.D3D9.HWnd);
                break;
index 3a40321dd1e758d61ec26192a2735936b567515c..caf695e7a28363b71b5a50226af1733fd6da2481 100644 (file)
@@ -39,12 +39,13 @@ static video::SMaterial baseMaterial()
 {
        video::SMaterial mat;
        mat.Lighting = false;
-#if ENABLE_GLES
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
        mat.ZBuffer = video::ECFN_DISABLED;
+       mat.ZWriteEnable = video::EZW_OFF;
 #else
+       mat.ZWriteEnable = false;
        mat.ZBuffer = video::ECFN_NEVER;
 #endif
-       mat.ZWriteEnable = false;
        mat.AntiAliasing = 0;
        mat.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
        mat.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
index b98e5de82e678245a8cffab0349461009cf86043..d6dbddf54afb0920014af99b0a45bd164d3e2d9c 100644 (file)
@@ -506,6 +506,13 @@ video::SColor GUIButton::getOverrideColor() const
        return OverrideColor;\r
 }\r
 \r
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8\r
+video::SColor GUIButton::getActiveColor() const\r
+{\r
+       return video::SColor(0,0,0,0); // unused?\r
+}\r
+#endif\r
+\r
 void GUIButton::enableOverrideColor(bool enable)\r
 {\r
        OverrideColorEnabled = enable;\r
index 4e1b04aacc1bea1c33759af481a3b75e4656c89e..834405f51093bd3bb12fd453f9a3a91ef72ec1b0 100644 (file)
@@ -69,6 +69,12 @@ using namespace irr;
 \r
 class ISimpleTextureSource;\r
 \r
+#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 8)\r
+#define OVERRIDE_19\r
+#else\r
+#define OVERRIDE_19 override\r
+#endif\r
+\r
 class GUIButton : public gui::IGUIButton\r
 {\r
 public:\r
@@ -97,22 +103,27 @@ class GUIButton : public gui::IGUIButton
        virtual gui::IGUIFont* getActiveFont() const override;\r
 \r
        //! Sets another color for the button text.\r
-       virtual void setOverrideColor(video::SColor color);\r
+       virtual void setOverrideColor(video::SColor color) OVERRIDE_19;\r
 \r
        //! Gets the override color\r
-       virtual video::SColor getOverrideColor(void) const;\r
+       virtual video::SColor getOverrideColor(void) const OVERRIDE_19;\r
+\r
+       #if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8\r
+       //! Gets the currently used text color\r
+       virtual video::SColor getActiveColor() const override;\r
+       #endif\r
 \r
        //! Sets if the button text should use the override color or the color in the gui skin.\r
-       virtual void enableOverrideColor(bool enable);\r
+       virtual void enableOverrideColor(bool enable) OVERRIDE_19;\r
 \r
        //! Checks if an override color is enabled\r
-       virtual bool isOverrideColorEnabled(void) const;\r
+       virtual bool isOverrideColorEnabled(void) const OVERRIDE_19;\r
 \r
        // PATCH\r
        //! Sets an image which should be displayed on the button when it is in the given state.\r
        virtual void setImage(gui::EGUI_BUTTON_IMAGE_STATE state,\r
                        video::ITexture* image=nullptr,\r
-                       const core::rect<s32>& sourceRect=core::rect<s32>(0,0,0,0));\r
+                       const core::rect<s32>& sourceRect=core::rect<s32>(0,0,0,0)) OVERRIDE_19;\r
 \r
        //! Sets an image which should be displayed on the button when it is in normal state.\r
        virtual void setImage(video::ITexture* image=nullptr) override;\r
@@ -141,7 +152,7 @@ class GUIButton : public gui::IGUIButton
        */\r
        virtual void setSprite(gui::EGUI_BUTTON_STATE state, s32 index,\r
                                                   video::SColor color=video::SColor(255,255,255,255),\r
-                                                  bool loop=false, bool scale=false);\r
+                                                  bool loop=false, bool scale=false) OVERRIDE_19;\r
 \r
 #if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 8)\r
        void setSprite(gui::EGUI_BUTTON_STATE state, s32 index, video::SColor color, bool loop) override {\r
@@ -150,16 +161,16 @@ class GUIButton : public gui::IGUIButton
 #endif\r
 \r
        //! Get the sprite-index for the given state or -1 when no sprite is set\r
-       virtual s32 getSpriteIndex(gui::EGUI_BUTTON_STATE state) const;\r
+       virtual s32 getSpriteIndex(gui::EGUI_BUTTON_STATE state) const OVERRIDE_19;\r
 \r
        //! Get the sprite color for the given state. Color is only used when a sprite is set.\r
-       virtual video::SColor getSpriteColor(gui::EGUI_BUTTON_STATE state) const;\r
+       virtual video::SColor getSpriteColor(gui::EGUI_BUTTON_STATE state) const OVERRIDE_19;\r
 \r
        //! Returns if the sprite in the given state does loop\r
-       virtual bool getSpriteLoop(gui::EGUI_BUTTON_STATE state) const;\r
+       virtual bool getSpriteLoop(gui::EGUI_BUTTON_STATE state) const OVERRIDE_19;\r
 \r
        //! Returns if the sprite in the given state is scaled\r
-       virtual bool getSpriteScale(gui::EGUI_BUTTON_STATE state) const;\r
+       virtual bool getSpriteScale(gui::EGUI_BUTTON_STATE state) const OVERRIDE_19;\r
 \r
        //! Sets if the button should behave like a push button. Which means it\r
        //! can be in two states: Normal or Pressed. With a click on the button,\r
@@ -199,13 +210,13 @@ class GUIButton : public gui::IGUIButton
        virtual bool isScalingImage() const override;\r
 \r
        //! Get if the shift key was pressed in last EGET_BUTTON_CLICKED event\r
-       virtual bool getClickShiftState() const\r
+       virtual bool getClickShiftState() const OVERRIDE_19\r
        {\r
                return ClickShiftState;\r
        }\r
 \r
        //! Get if the control key was pressed in last EGET_BUTTON_CLICKED event\r
-       virtual bool getClickControlState() const\r
+       virtual bool getClickControlState() const OVERRIDE_19\r
        {\r
                return ClickControlState;\r
        }\r
index bf61cd64eb3e9fb5d25c983745aa95d0691dad25..a8cc333526bda51c33b7c0c7f47dda52f56b31ea 100644 (file)
@@ -255,6 +255,12 @@ video::SColor StaticText::getOverrideColor() const
        return ColoredText.getDefaultColor();
 }
 
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+video::SColor StaticText::getActiveColor() const
+{
+       return getOverrideColor();
+}
+#endif
 
 //! Sets if the static text should use the overide color or the
 //! color in the gui skin.
index 1f111ea56e810d7e68dd75938efc29e088a21391..786129d5728b77b295bf24f27a2136a662532816 100644 (file)
@@ -140,6 +140,11 @@ namespace gui
                virtual video::SColor getOverrideColor() const;
                #endif
 
+               #if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+               //! Gets the currently used text color
+               virtual video::SColor getActiveColor() const;
+               #endif
+
                //! Sets if the static text should use the overide color or the
                //! color in the gui skin.
                virtual void enableOverrideColor(bool enable);