mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Draw node animation for items (#15930)
This commit is contained in:
parent
1db5a2f950
commit
a6d4cd7c15
9 changed files with 117 additions and 74 deletions
|
@ -118,13 +118,13 @@ void drawItemStack(
|
|||
client->idef()->getItemstackColor(item, client);
|
||||
|
||||
const u32 mc = mesh->getMeshBufferCount();
|
||||
if (mc > imesh->buffer_colors.size())
|
||||
imesh->buffer_colors.resize(mc);
|
||||
if (mc > imesh->buffer_info.size())
|
||||
imesh->buffer_info.resize(mc);
|
||||
for (u32 j = 0; j < mc; ++j) {
|
||||
scene::IMeshBuffer *buf = mesh->getMeshBuffer(j);
|
||||
video::SColor c = basecolor;
|
||||
|
||||
auto &p = imesh->buffer_colors[j];
|
||||
auto &p = imesh->buffer_info[j];
|
||||
p.applyOverride(c);
|
||||
|
||||
// TODO: could be moved to a shader
|
||||
|
@ -137,6 +137,12 @@ void drawItemStack(
|
|||
}
|
||||
|
||||
video::SMaterial &material = buf->getMaterial();
|
||||
|
||||
// Texture animation
|
||||
if (p.animation_info) {
|
||||
p.animation_info->updateTexture(material, client->getAnimationTime());
|
||||
}
|
||||
|
||||
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
|
||||
driver->setMaterial(material);
|
||||
driver->drawMeshBuffer(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue