1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-31 18:31:04 +00:00

CAO 'node' visual (#15683)

This commit is contained in:
sfan5 2025-01-14 20:25:52 +01:00
parent 5a8720a484
commit 27bbe3a873
14 changed files with 267 additions and 91 deletions

View file

@ -18,6 +18,21 @@ struct PreMeshBuffer
PreMeshBuffer() = default;
explicit PreMeshBuffer(const TileLayer &layer) : layer(layer) {}
/// @brief Colorizes vertices as indicated by tile layer
void applyTileColor()
{
video::SColor tc = layer.color;
if (tc == video::SColor(0xFFFFFFFF))
return;
for (auto &vertex : vertices) {
video::SColor *c = &vertex.Color;
c->set(c->getAlpha(),
c->getRed() * tc.getRed() / 255U,
c->getGreen() * tc.getGreen() / 255U,
c->getBlue() * tc.getBlue() / 255U);
}
}
};
struct MeshCollector