aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2019-08-07 12:07:30 +0200
committersfan5 <sfan5@live.de>2019-08-07 12:07:30 +0200
commit1cef09ff10515ae56884e766ddb4b27ef44a9572 (patch)
treee027a5eca11ed7f453556e0f41c1bed7b9840ffe
parent19426387d4b1bb3b96094cdab97452c2e248f47d (diff)
downloadminetest-1cef09ff10515ae56884e766ddb4b27ef44a9572.tar.gz
minetest-1cef09ff10515ae56884e766ddb4b27ef44a9572.tar.bz2
minetest-1cef09ff10515ae56884e766ddb4b27ef44a9572.zip
Fix inventory_overlay for nodes without inventory_image (#8433)
-rw-r--r--src/client/hud.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/hud.cpp b/src/client/hud.cpp
index 51746f788..291d03816 100644
--- a/src/client/hud.cpp
+++ b/src/client/hud.cpp
@@ -714,6 +714,16 @@ void drawItemStack(video::IVideoDriver *driver,
driver->setTransform(video::ETS_VIEW, oldViewMat);
driver->setTransform(video::ETS_PROJECTION, oldProjMat);
driver->setViewPort(oldViewPort);
+
+ // draw the inventory_overlay
+ if (def.type == ITEM_NODE && def.inventory_image.empty() &&
+ !def.inventory_overlay.empty()) {
+ ITextureSource *tsrc = client->getTextureSource();
+ video::ITexture *overlay_texture = tsrc->getTexture(def.inventory_overlay);
+ core::dimension2d<u32> dimens = overlay_texture->getOriginalSize();
+ core::rect<s32> srcrect(0, 0, dimens.Width, dimens.Height);
+ draw2DImageFilterScaled(driver, overlay_texture, rect, srcrect, clip, 0, true);
+ }
}
if(def.type == ITEM_TOOL && item.wear != 0)