Tech ENABLE_COLOR_CLASSES set as default

This commit is contained in:
enricoturri1966 2022-01-14 08:19:00 +01:00
parent fab35e8aa4
commit 6201dad245
50 changed files with 18 additions and 1500 deletions
src/slic3r/GUI

View file

@ -165,7 +165,6 @@ bool GLModel::init_from_file(const std::string& filename)
return true;
}
#if ENABLE_COLOR_CLASSES
void GLModel::set_color(int entity_id, const ColorRGBA& color)
{
for (size_t i = 0; i < m_render_data.size(); ++i) {
@ -173,15 +172,6 @@ void GLModel::set_color(int entity_id, const ColorRGBA& color)
m_render_data[i].color = color;
}
}
#else
void GLModel::set_color(int entity_id, const std::array<float, 4>& color)
{
for (size_t i = 0; i < m_render_data.size(); ++i) {
if (entity_id == -1 || static_cast<int>(i) == entity_id)
m_render_data[i].color = color;
}
}
#endif // ENABLE_COLOR_CLASSES
void GLModel::reset()
{
@ -226,11 +216,7 @@ void GLModel::render() const
if (shader != nullptr)
shader->set_uniform("uniform_color", data.color);
else
#if ENABLE_COLOR_CLASSES
glsafe(::glColor4fv(data.color.data()));
#else
glsafe(::glColor4fv(data.color.data()));
#endif // ENABLE_COLOR_CLASSES
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.ibo_id));
glsafe(::glDrawElements(mode, static_cast<GLsizei>(data.indices_count), GL_UNSIGNED_INT, (const void*)0));
@ -290,11 +276,7 @@ void GLModel::render_instanced(unsigned int instances_vbo, unsigned int instance
if (shader != nullptr)
shader->set_uniform("uniform_color", data.color);
else
#if ENABLE_COLOR_CLASSES
glsafe(::glColor4fv(data.color.data()));
#else
glsafe(::glColor4fv(data.color.data()));
#endif // ENABLE_COLOR_CLASSES
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, data.vbo_id));
if (position_id != -1) {