Improve item drop beam

This commit is contained in:
Kae 2023-08-20 12:08:58 +10:00
parent 9af6bfe60e
commit bda94556bb

View File

@ -285,10 +285,12 @@ void ItemDrop::render(RenderCallback* renderCallback) {
} }
beamColor.setAlphaF(0.8f); beamColor.setAlphaF(0.8f);
auto line = Drawable::makeLine({ Vec2F(), Vec2F(0.0f, 1.5f) }, 2.0f, beamColor, position()); Line2F line = { Vec2F(), Vec2F(0.0f, 1.0f + m_boundBox.height() / 2) };
(line.linePart().endColor = beamColor)->setAlphaF(0.0f); float width = min(2.0f, m_boundBox.width() * TilePixels);
line.fullbright = true; auto drawable = Drawable::makeLine(line, width, beamColor, position());
renderCallback->addDrawable(move(line), RenderLayerItemDrop); (drawable.linePart().endColor = beamColor)->setAlphaF(0.0f);
drawable.fullbright = true;
renderCallback->addDrawable(move(drawable), RenderLayerItemDrop);
} }
if (!m_drawables) { if (!m_drawables) {