diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2016-02-13 22:08:58 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2016-02-13 22:19:01 +0100 |
commit | c17c40a0f5f4276c576400259e691f1273370193 (patch) | |
tree | b155e64617551dc97c5bf0d8354718583ddfc143 | |
parent | 5ca48a35a610aefd5c34d615cb49900f423b7aa6 (diff) | |
download | minetest-c17c40a0f5f4276c576400259e691f1273370193.tar.gz minetest-c17c40a0f5f4276c576400259e691f1273370193.tar.bz2 minetest-c17c40a0f5f4276c576400259e691f1273370193.zip |
Formspec: fix broken irrlicht 1.7 build
Fixes #3701.
-rw-r--r-- | src/guiFormSpecMenu.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 8a657a2ff..2e9421b3e 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2434,9 +2434,14 @@ void GUIFormSpecMenu::drawMenu() // Viewport rectangle on screen core::rect<s32> rect = imgrect + spec.pos; if (spec.parent_button && spec.parent_button->isPressed()) { +#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8) + rect += core::dimension2d<s32>( + 0.05 * (float)rect.getWidth(), 0.05 * (float)rect.getHeight()); +#else rect += core::dimension2d<s32>( skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X), skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y)); +#endif } drawItemStack(driver, m_font, item, rect, &AbsoluteClippingRect, m_gamedef, IT_ROT_NONE); @@ -2472,11 +2477,16 @@ void GUIFormSpecMenu::drawMenu() const StaticTextSpec &spec = m_static_texts[i]; core::rect<s32> rect = spec.rect; if (spec.parent_button && spec.parent_button->isPressed()) { +#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8) + rect += core::dimension2d<s32>( + 0.05 * (float)rect.getWidth(), 0.05 * (float)rect.getHeight()); +#else // Use image offset instead of text's because its a bit smaller // and fits better, also TEXT_OFFSET_X is always 0 rect += core::dimension2d<s32>( skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X), skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y)); +#endif } video::SColor color(255, 255, 255, 255); m_font->draw(spec.text.c_str(), rect, color, true, true, &rect); |