Skip to content

Commit c17c40a

Browse files
RealBadAngelest31
authored andcommittedFeb 13, 2016
Formspec: fix broken irrlicht 1.7 build
Fixes #3701.
1 parent 5ca48a3 commit c17c40a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

Diff for: ‎src/guiFormSpecMenu.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -2434,9 +2434,14 @@ void GUIFormSpecMenu::drawMenu()
24342434
// Viewport rectangle on screen
24352435
core::rect<s32> rect = imgrect + spec.pos;
24362436
if (spec.parent_button && spec.parent_button->isPressed()) {
2437+
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
2438+
rect += core::dimension2d<s32>(
2439+
0.05 * (float)rect.getWidth(), 0.05 * (float)rect.getHeight());
2440+
#else
24372441
rect += core::dimension2d<s32>(
24382442
skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X),
24392443
skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y));
2444+
#endif
24402445
}
24412446
drawItemStack(driver, m_font, item, rect, &AbsoluteClippingRect,
24422447
m_gamedef, IT_ROT_NONE);
@@ -2472,11 +2477,16 @@ void GUIFormSpecMenu::drawMenu()
24722477
const StaticTextSpec &spec = m_static_texts[i];
24732478
core::rect<s32> rect = spec.rect;
24742479
if (spec.parent_button && spec.parent_button->isPressed()) {
2480+
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
2481+
rect += core::dimension2d<s32>(
2482+
0.05 * (float)rect.getWidth(), 0.05 * (float)rect.getHeight());
2483+
#else
24752484
// Use image offset instead of text's because its a bit smaller
24762485
// and fits better, also TEXT_OFFSET_X is always 0
24772486
rect += core::dimension2d<s32>(
24782487
skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X),
24792488
skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y));
2489+
#endif
24802490
}
24812491
video::SColor color(255, 255, 255, 255);
24822492
m_font->draw(spec.text.c_str(), rect, color, true, true, &rect);

0 commit comments

Comments
 (0)
Please sign in to comment.