Drawable Renderer (#1570), warnings

This commit is contained in:
Tim Sylvester
2023-04-27 15:29:18 -07:00
committed by Bart Louwers
parent b8c0b1a97c
commit 8a42b2fa5f
2 changed files with 9 additions and 5 deletions

View File

@@ -24,9 +24,13 @@ void DrawableGLBuilder::init() {
if (auto colorAttr = attrs.getOrAdd("a_color")) {
std::size_t index = 0;
for (const auto& color : impl->colors) {
const auto comp = util::convert<float>(color.toArray());
const auto norm = gfx::VertexAttribute::float4{comp[0]/255.f,comp[1]/255.f,comp[2]/255.f,comp[3]};
colorAttr->set(index++, norm);
const auto comp = color.toArray();
colorAttr->set(index++, gfx::VertexAttribute::float4 {
static_cast<float>(comp[0]/255.0),
static_cast<float>(comp[1]/255.0),
static_cast<float>(comp[2]/255.0),
static_cast<float>(comp[3]),
});
}
}