const Shape *shape;
std::vector<float> textures;
- TVEC3<unsigned char, glm::precision(0)> hsl_mod;
- TVEC3<unsigned char, glm::precision(0)> rgb_mod;
- TVEC3<unsigned char, glm::precision(0)> outline_color;
+ BlockMesh::ColorMod hsl_mod;
+ BlockMesh::ColorMod rgb_mod;
+ PrimitiveMesh::Color outline_color;
/// gravity configuration or null if not emitting gravity
std::unique_ptr<BlockGravity> gravity;
, textures()
, hsl_mod(0, 255, 255)
, rgb_mod(255, 255, 255)
-, outline_color(0, 0, 0)
+, outline_color(0, 0, 0, 255)
, gravity()
, name("anonymous")
, label("some block")
hsl_mod = BlockMesh::ColorMod(color_conv * 255.0f);
} else if (name == "outline") {
in.ReadVec(color_conv);
- outline_color = BlockMesh::ColorMod(color_conv * 255.0f);
+ outline_color = PrimitiveMesh::Color(color_conv * 255.0f, 255);
} else if (name == "gravity") {
gravity = BlockGravity::Read(in);
} else if (name == "label") {
void BlockType::OutlinePrimitiveMesh(PrimitiveMesh::Buffer &buf) const noexcept {
if (!shape) return;
shape->Outline(buf);
- buf.colors.insert(buf.colors.end(), shape->OutlineCount(), PrimitiveMesh::Color(outline_color, 255));
+ buf.colors.insert(buf.colors.end(), shape->OutlineCount(), outline_color);
}
PrimitiveMesh debug_mesh;
PlainColor &prog = viewport.WorldColorProgram();
for (const Entity &entity : entities) {
- debug_buf.OutlineBox(entity.Bounds(), TVEC4<unsigned char, glm::precision(0)>(255, 0, 0, 255));
+ debug_buf.OutlineBox(entity.Bounds(), PrimitiveMesh::Color(255, 0, 0, 255));
debug_mesh.Update(debug_buf);
prog.SetM(entity.Transform(players.front().GetEntity().ChunkCoords()));
debug_mesh.DrawLines();