Follow-up of 033bee6431 - Fixed warnings

This commit is contained in:
enricoturri1966 2022-03-15 10:31:30 +01:00
parent 63237ae487
commit 9701d3b01d

View File

@ -2955,15 +2955,11 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
void GCodeViewer::render_toolpaths()
{
const float point_size = 0.8f;
#if !ENABLE_GL_SHADERS_ATTRIBUTES
const std::array<float, 4> light_intensity = { 0.25f, 0.70f, 0.75f, 0.75f };
#endif // !ENABLE_GL_SHADERS_ATTRIBUTES
const Camera& camera = wxGetApp().plater()->get_camera();
const double zoom = camera.get_zoom();
const std::array<int, 4>& viewport = camera.get_viewport();
const float near_plane_height = camera.get_type() == Camera::EType::Perspective ? static_cast<float>(viewport[3]) / (2.0f * static_cast<float>(2.0 * std::tan(0.5 * Geometry::deg2rad(camera.get_fov())))) :
static_cast<float>(viewport[3]) * 0.0005;
#if !ENABLE_GL_SHADERS_ATTRIBUTES
auto shader_init_as_lines = [light_intensity](GLShaderProgram &shader) {
@ -3245,9 +3241,9 @@ void GCodeViewer::render_toolpaths()
}
#if ENABLE_GCODE_VIEWER_STATISTICS
auto render_sequential_range_cap = [this]
auto render_sequential_range_cap = [this, &camera]
#else
auto render_sequential_range_cap = []
auto render_sequential_range_cap = [&camera]
#endif // ENABLE_GCODE_VIEWER_STATISTICS
(const SequentialRangeCap& cap) {
const TBuffer* buffer = cap.buffer;
@ -3258,7 +3254,6 @@ void GCodeViewer::render_toolpaths()
shader->start_using();
#if ENABLE_GL_SHADERS_ATTRIBUTES
const Camera& camera = wxGetApp().plater()->get_camera();
const Transform3d& view_matrix = camera.get_view_matrix();
shader->set_uniform("view_model_matrix", view_matrix);
shader->set_uniform("projection_matrix", camera.get_projection_matrix());