From ab99a7865f92d33485a4eebc6487634e28dbaf31 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 22 Dec 2021 11:31:35 +0100 Subject: [PATCH] Fixed build of test_color.cpp on non-Windows OSs --- src/slic3r/GUI/GLCanvas3D.cpp | 2 ++ tests/libslic3r/test_color.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 94edc797d..df5efeb48 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5377,7 +5377,9 @@ void GLCanvas3D::_render_overlays() void GLCanvas3D::_render_volumes_for_picking() const { +#if !ENABLE_COLOR_CLASSES static const GLfloat INV_255 = 1.0f / 255.0f; +#endif // !ENABLE_COLOR_CLASSES // do not cull backfaces to show broken geometry, if any glsafe(::glDisable(GL_CULL_FACE)); diff --git a/tests/libslic3r/test_color.cpp b/tests/libslic3r/test_color.cpp index f139917e0..dcfb8526d 100644 --- a/tests/libslic3r/test_color.cpp +++ b/tests/libslic3r/test_color.cpp @@ -9,7 +9,7 @@ using namespace Slic3r; SCENARIO("Color encoding/decoding cycle", "[Color]") { GIVEN("Color") { - const ColorRGB src_rgb(unsigned char(255), unsigned char(127), unsigned char(63)); + const ColorRGB src_rgb(static_cast(255), static_cast(127), static_cast(63)); WHEN("apply encode/decode cycle") { const std::string encoded = encode_color(src_rgb); ColorRGB res_rgb; @@ -24,7 +24,7 @@ SCENARIO("Color encoding/decoding cycle", "[Color]") { SCENARIO("Color picking encoding/decoding cycle", "[Color]") { GIVEN("Picking color") { - const ColorRGB src_rgb(unsigned char(255), unsigned char(127), unsigned char(63)); + const ColorRGB src_rgb(static_cast(255), static_cast(127), static_cast(63)); WHEN("apply encode/decode cycle") { const unsigned int encoded = picking_encode(src_rgb.r_uchar(), src_rgb.g_uchar(), src_rgb.b_uchar()); const ColorRGBA res_rgba = picking_decode(encoded);