--- a/src/gl/compiler.cpp Mon Jul 04 15:37:22 2022 +0300 +++ b/src/gl/compiler.cpp Mon Jul 04 19:53:13 2022 +0300 @@ -295,8 +295,8 @@ vertex.position = point; vertex.normal = normal; vertex.color = glm::vec4{color.redF(), color.greenF(), color.blueF(), color.alphaF()}; - vertex.id = polygon.id.value; - vertex.pickcolor = idToColor(polygon.id.value); + vertex.id = polygon.linenumber; + vertex.pickcolor = idToColor(polygon.linenumber); }); }); for (gl::ModelShaders::ShaderObject& shader : shaders->shaderObjects) @@ -309,13 +309,12 @@ } } -ElementId gl::idFromUcharColor(const std::array<GLubyte, 3>& data) +int gl::idFromUcharColor(const std::array<GLubyte, 3>& data) { - return { + return static_cast<std::int32_t>(data[0]) | static_cast<std::int32_t>(data[1]) << 8 | - static_cast<std::int32_t>(data[2]) << 16 - }; + static_cast<std::int32_t>(data[2]) << 16; } void gl::bindModelShaderVertexArray(gl::ModelShaders* shaders, gl::ArrayClass arrayClass) @@ -332,6 +331,7 @@ shaderObject.vertexArray.release(); } +/* void gl::setModelShaderSelectedObjects(gl::ModelShaders* shaders, const QSet<ElementId> &ids) { for (ModelShaders::ShaderObject& object : shaders->shaderObjects) @@ -347,6 +347,7 @@ object.buffer.release(); } } +*/ std::size_t gl::vertexCount(const gl::ModelShaders* shaders, const gl::ArrayClass arrayClass) {