]> git.lizzy.rs Git - minetest.git/blobdiff - src/gui/guiButton.h
Remove dead code behind Irrlicht version checks
[minetest.git] / src / gui / guiButton.h
index ee9bb6f2196412fcef5a09f51bee845d3488f2ec..5e379b28f05e220b778209472c545a582791cd1f 100644 (file)
 \r
 using namespace irr;\r
 \r
-#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 8)\r
-       namespace irr { namespace gui {\r
-\r
-               //! State of buttons used for drawing texture images.\r
-               //! Note that only a single state is active at a time\r
-               //! Also when no image is defined for a state it will use images from another state\r
-               //! and if that state is not set from the replacement for that,etc.\r
-               //! So in many cases setting EGBIS_IMAGE_UP and EGBIS_IMAGE_DOWN is sufficient.\r
-               enum EGUI_BUTTON_IMAGE_STATE {\r
-                       //! When no other states have images they will all use this one.\r
-                                       EGBIS_IMAGE_UP,\r
-                       //! When not set EGBIS_IMAGE_UP is used.\r
-                                       EGBIS_IMAGE_UP_MOUSEOVER,\r
-                       //! When not set EGBIS_IMAGE_UP_MOUSEOVER is used.\r
-                                       EGBIS_IMAGE_UP_FOCUSED,\r
-                       //! When not set EGBIS_IMAGE_UP_FOCUSED is used.\r
-                                       EGBIS_IMAGE_UP_FOCUSED_MOUSEOVER,\r
-                       //! When not set EGBIS_IMAGE_UP is used.\r
-                                       EGBIS_IMAGE_DOWN,\r
-                       //! When not set EGBIS_IMAGE_DOWN is used.\r
-                                       EGBIS_IMAGE_DOWN_MOUSEOVER,\r
-                       //! When not set EGBIS_IMAGE_DOWN_MOUSEOVER is used.\r
-                                       EGBIS_IMAGE_DOWN_FOCUSED,\r
-                       //! When not set EGBIS_IMAGE_DOWN_FOCUSED is used.\r
-                                       EGBIS_IMAGE_DOWN_FOCUSED_MOUSEOVER,\r
-                       //! When not set EGBIS_IMAGE_UP or EGBIS_IMAGE_DOWN are used (depending on button state).\r
-                                       EGBIS_IMAGE_DISABLED,\r
-                       //! not used, counts the number of enumerated items\r
-                                       EGBIS_COUNT\r
-               };\r
-\r
-               //! Names for gui button image states\r
-               const c8 *const GUIButtonImageStateNames[EGBIS_COUNT + 1] =\r
-                               {\r
-                                               "Image",    // not "ImageUp" as it otherwise breaks serialization of old files\r
-                                               "ImageUpOver",\r
-                                               "ImageUpFocused",\r
-                                               "ImageUpFocusedOver",\r
-                                               "PressedImage",    // not "ImageDown" as it otherwise breaks serialization of old files\r
-                                               "ImageDownOver",\r
-                                               "ImageDownFocused",\r
-                                               "ImageDownFocusedOver",\r
-                                               "ImageDisabled",\r
-                                               0    // count\r
-                               };\r
-\r
-       }}\r
-\r
-#endif\r
-\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
@@ -103,27 +47,25 @@ 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) OVERRIDE_19;\r
+       virtual void setOverrideColor(video::SColor color) override;\r
 \r
        //! Gets the override color\r
-       virtual video::SColor getOverrideColor(void) const OVERRIDE_19;\r
+       virtual video::SColor getOverrideColor() const override;\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) OVERRIDE_19;\r
+       virtual void enableOverrideColor(bool enable) override;\r
 \r
        //! Checks if an override color is enabled\r
-       virtual bool isOverrideColorEnabled(void) const OVERRIDE_19;\r
+       virtual bool isOverrideColorEnabled(void) const override;\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)) OVERRIDE_19;\r
+                       const core::rect<s32>& sourceRect=core::rect<s32>(0,0,0,0)) override;\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
@@ -152,25 +94,19 @@ 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) 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
-               setSprite(state, index, color, loop, false);\r
-       }\r
-#endif\r
+                                                  bool loop=false, bool scale=false) override;\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 OVERRIDE_19;\r
+       virtual s32 getSpriteIndex(gui::EGUI_BUTTON_STATE state) const override;\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 OVERRIDE_19;\r
+       virtual video::SColor getSpriteColor(gui::EGUI_BUTTON_STATE state) const override;\r
 \r
        //! Returns if the sprite in the given state does loop\r
-       virtual bool getSpriteLoop(gui::EGUI_BUTTON_STATE state) const OVERRIDE_19;\r
+       virtual bool getSpriteLoop(gui::EGUI_BUTTON_STATE state) const override;\r
 \r
        //! Returns if the sprite in the given state is scaled\r
-       virtual bool getSpriteScale(gui::EGUI_BUTTON_STATE state) const OVERRIDE_19;\r
+       virtual bool getSpriteScale(gui::EGUI_BUTTON_STATE state) const override;\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
@@ -210,13 +146,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 OVERRIDE_19\r
+       virtual bool getClickShiftState() const override\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 OVERRIDE_19\r
+       virtual bool getClickControlState() const override\r
        {\r
                return ClickControlState;\r
        }\r