Skip to content
Permalink
Browse files

Fix inventory_overlay for nodes without inventory_image (#8433)

  • Loading branch information...
DS-Minetest authored and sfan5 committed Aug 7, 2019
1 parent 1942638 commit 1cef09ff10515ae56884e766ddb4b27ef44a9572
Showing with 10 additions and 0 deletions.
  1. +10 −0 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)

0 comments on commit 1cef09f

Please sign in to comment.
You can’t perform that action at this time.