From 5e05b44c26c1b57aaceb5e3478ccf5f98e3f14d7 Mon Sep 17 00:00:00 2001 From: clasher113 Date: Sun, 15 Mar 2026 11:05:26 +0200 Subject: [PATCH] fix vec3 shadeless flag --- src/coders/vec3.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/coders/vec3.cpp b/src/coders/vec3.cpp index 974b9a633..e00bdd662 100644 --- a/src/coders/vec3.cpp +++ b/src/coders/vec3.cpp @@ -23,6 +23,10 @@ enum AttributeType { COLOR }; +enum MaterialFlag { + SHADELESS = 1 +}; + struct VertexAttribute { AttributeType type; int flags; @@ -62,7 +66,7 @@ static VertexAttribute load_attribute(ByteReader& reader) { static model::Mesh build_mesh( const std::vector& attrs, const util::Buffer& indices, - const std::string& texture + const Material& material ) { const glm::vec3* coords = nullptr; const glm::vec2* uvs = nullptr; @@ -112,7 +116,11 @@ static model::Mesh build_mesh( } vertices.push_back(std::move(vertex)); } - return model::Mesh {texture, std::move(vertices)}; + return model::Mesh { + material.name, + std::move(vertices), + (material.flags & MaterialFlag::SHADELESS) == 0 + }; } static model::Mesh load_mesh( @@ -154,7 +162,7 @@ static model::Mesh load_mesh( return build_mesh( attributes, indices, - materials.at(materialId).name + materials.at(materialId) ); }