aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mg_schematic.h
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2020-05-04 20:19:12 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-05-05 08:37:04 +0200
commitcad5b987ad4720bd6a49d3604be9e81ea348f799 (patch)
treebd12705293670c9bcfc29c01ac19a1afc44e4e4b /src/mapgen/mg_schematic.h
parent1b6f40c35632ab5a2066822c8b5d4c09d469f49d (diff)
downloadminetest-cad5b987ad4720bd6a49d3604be9e81ea348f799.tar.gz
minetest-cad5b987ad4720bd6a49d3604be9e81ea348f799.tar.bz2
minetest-cad5b987ad4720bd6a49d3604be9e81ea348f799.zip
Sky API: Rename *_tint to fog_*_tint for consistency
Diffstat (limited to 'src/mapgen/mg_schematic.h')
0 files changed, 0 insertions, 0 deletions
GUIBackgroundImage::GUIBackgroundImage(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, const core::rect<s32> &rectangle, const std::string &name, const core::rect<s32> &middle, ISimpleTextureSource *tsrc, bool autoclip) : gui::IGUIElement(gui::EGUIET_ELEMENT, env, parent, id, rectangle), m_name(name), m_middle(middle), m_tsrc(tsrc), m_autoclip(autoclip) { } void GUIBackgroundImage::draw() { if (!IsVisible) return; video::ITexture *texture = m_tsrc->getTexture(m_name); if (!texture) { errorstream << "GUIBackgroundImage::draw() Unable to load texture:" << std::endl; errorstream << "\t" << m_name << std::endl; return; } core::rect<s32> rect = AbsoluteRect; if (m_autoclip) rect.LowerRightCorner += Parent->getAbsoluteClippingRect().getSize(); video::IVideoDriver *driver = Environment->getVideoDriver(); if (m_middle.getArea() == 0) { const video::SColor color(255, 255, 255, 255); const video::SColor colors[] = {color, color, color, color}; draw2DImageFilterScaled(driver, texture, rect, core::rect<s32>(core::position2d<s32>(0, 0), core::dimension2di(texture->getOriginalSize())), nullptr, colors, true); } else { core::rect<s32> middle = m_middle; // `-x` is interpreted as `w - x` if (middle.LowerRightCorner.X < 0) middle.LowerRightCorner.X += texture->getOriginalSize().Width; if (middle.LowerRightCorner.Y < 0) middle.LowerRightCorner.Y += texture->getOriginalSize().Height; draw2DImage9Slice(driver, texture, rect, middle); } IGUIElement::draw(); }