diff --git a/resources/profiles/Artillery/bed-x1.png b/resources/profiles/Artillery/bed-x1.png index 16062e93c1..bcf2e85eb4 100644 Binary files a/resources/profiles/Artillery/bed-x1.png and b/resources/profiles/Artillery/bed-x1.png differ diff --git a/resources/profiles/RatRig/rr-vc-300.stl b/resources/profiles/RatRig/rr-vc-300.stl index 282f31a084..640e86890f 100644 Binary files a/resources/profiles/RatRig/rr-vc-300.stl and b/resources/profiles/RatRig/rr-vc-300.stl differ diff --git a/resources/profiles/RatRig/rr-vc-400.stl b/resources/profiles/RatRig/rr-vc-400.stl index 8605f3eccd..422354ee20 100644 Binary files a/resources/profiles/RatRig/rr-vc-400.stl and b/resources/profiles/RatRig/rr-vc-400.stl differ diff --git a/resources/profiles/RatRig/rr-vc-500.stl b/resources/profiles/RatRig/rr-vc-500.stl index 75f1878458..5427b11577 100644 Binary files a/resources/profiles/RatRig/rr-vc-500.stl and b/resources/profiles/RatRig/rr-vc-500.stl differ diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp index bf2a219d0d..8124b23e3e 100644 --- a/src/libslic3r/Arrange.cpp +++ b/src/libslic3r/Arrange.cpp @@ -552,7 +552,7 @@ static CircleBed to_circle(const Point ¢er, const Points& points) { std::vector vertex_distances; double avg_dist = 0; - for (auto pt : points) + for (const Point& pt : points) { double distance = distance_to(center, pt); vertex_distances.push_back(distance); diff --git a/src/libslic3r/Color.cpp b/src/libslic3r/Color.cpp index 7b5a7f3ba7..4d3bc6793d 100644 --- a/src/libslic3r/Color.cpp +++ b/src/libslic3r/Color.cpp @@ -130,6 +130,8 @@ bool ColorRGB::operator < (const ColorRGB& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] < other.m_data[i]) return true; + else if (m_data[i] > other.m_data[i]) + return false; } return false; @@ -140,6 +142,8 @@ bool ColorRGB::operator > (const ColorRGB& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] > other.m_data[i]) return true; + else if (m_data[i] < other.m_data[i]) + return false; } return false; @@ -179,6 +183,8 @@ bool ColorRGBA::operator < (const ColorRGBA& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] < other.m_data[i]) return true; + else if (m_data[i] > other.m_data[i]) + return false; } return false; @@ -189,6 +195,8 @@ bool ColorRGBA::operator > (const ColorRGBA& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] > other.m_data[i]) return true; + else if (m_data[i] < other.m_data[i]) + return false; } return false; diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index 18b97665da..0297a8d426 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -306,7 +306,7 @@ ConfigOptionDef* ConfigDef::add_nullable(const t_config_option_key &opt_key, Con std::ostream& ConfigDef::print_cli_help(std::ostream& out, bool show_defaults, std::function filter) const { // prepare a function for wrapping text - auto wrap = [](std::string text, size_t line_length) -> std::string { + auto wrap = [](const std::string& text, size_t line_length) -> std::string { std::istringstream words(text); std::ostringstream wrapped; std::string word; @@ -335,7 +335,7 @@ std::ostream& ConfigDef::print_cli_help(std::ostream& out, bool show_defaults, s categories.insert(def.category); } - for (auto category : categories) { + for (const std::string& category : categories) { if (category != "") { out << category << ":" << std::endl; } else if (categories.size() > 1) { diff --git a/src/libslic3r/CustomGCode.cpp b/src/libslic3r/CustomGCode.cpp index 193235bf83..213437782f 100644 --- a/src/libslic3r/CustomGCode.cpp +++ b/src/libslic3r/CustomGCode.cpp @@ -41,7 +41,7 @@ extern void check_mode_for_custom_gcode_per_print_z(Info& info) return; bool is_single_extruder = true; - for (auto item : info.gcodes) + for (const Item& item : info.gcodes) { if (item.type == ToolChange) { info.mode = MultiAsSingle; diff --git a/src/libslic3r/ExPolygon.hpp b/src/libslic3r/ExPolygon.hpp index 6f38846736..cbf6b1c1a2 100644 --- a/src/libslic3r/ExPolygon.hpp +++ b/src/libslic3r/ExPolygon.hpp @@ -169,10 +169,10 @@ inline Polylines to_polylines(ExPolygon &&src) Polyline &pl = polylines[idx ++]; pl.points = std::move(src.contour.points); pl.points.push_back(pl.points.front()); - for (Polygons::const_iterator ith = src.holes.begin(); ith != src.holes.end(); ++ith) { + for (auto ith = src.holes.begin(); ith != src.holes.end(); ++ith) { Polyline &pl = polylines[idx ++]; pl.points = std::move(ith->points); - pl.points.push_back(ith->points.front()); + pl.points.push_back(pl.points.front()); } assert(idx == polylines.size()); return polylines; @@ -183,14 +183,14 @@ inline Polylines to_polylines(ExPolygons &&src) Polylines polylines; polylines.assign(number_polygons(src), Polyline()); size_t idx = 0; - for (ExPolygons::const_iterator it = src.begin(); it != src.end(); ++it) { + for (auto it = src.begin(); it != src.end(); ++it) { Polyline &pl = polylines[idx ++]; pl.points = std::move(it->contour.points); pl.points.push_back(pl.points.front()); - for (Polygons::const_iterator ith = it->holes.begin(); ith != it->holes.end(); ++ith) { + for (auto ith = it->holes.begin(); ith != it->holes.end(); ++ith) { Polyline &pl = polylines[idx ++]; pl.points = std::move(ith->points); - pl.points.push_back(ith->points.front()); + pl.points.push_back(pl.points.front()); } } assert(idx == polylines.size()); diff --git a/src/libslic3r/ExtrusionEntity.hpp b/src/libslic3r/ExtrusionEntity.hpp index 1c990f5eaf..5e6a51d20a 100644 --- a/src/libslic3r/ExtrusionEntity.hpp +++ b/src/libslic3r/ExtrusionEntity.hpp @@ -242,7 +242,7 @@ public: ExtrusionLoop(ExtrusionPaths &&paths, ExtrusionLoopRole role = elrDefault) : paths(std::move(paths)), m_loop_role(role) {} ExtrusionLoop(const ExtrusionPath &path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role) { this->paths.push_back(path); } - ExtrusionLoop(const ExtrusionPath &&path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role) + ExtrusionLoop(ExtrusionPath &&path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role) { this->paths.emplace_back(std::move(path)); } bool is_loop() const override{ return true; } bool can_reverse() const override { return false; } diff --git a/src/libslic3r/Fill/FillBase.hpp b/src/libslic3r/Fill/FillBase.hpp index 6c57a64bfa..9ba060b853 100644 --- a/src/libslic3r/Fill/FillBase.hpp +++ b/src/libslic3r/Fill/FillBase.hpp @@ -125,7 +125,7 @@ protected: unsigned int /* thickness_layers */, const std::pair & /* direction */, ExPolygon /* expolygon */, - Polylines & /* polylines_out */) {}; + Polylines & /* polylines_out */) {} virtual float _layer_angle(size_t idx) const { return (idx & 1) ? float(M_PI/2.) : 0; } diff --git a/src/libslic3r/Layer.hpp b/src/libslic3r/Layer.hpp index a308ac0b62..0fe4952f4a 100644 --- a/src/libslic3r/Layer.hpp +++ b/src/libslic3r/Layer.hpp @@ -18,7 +18,7 @@ class PrintObject; namespace FillAdaptive { struct Octree; -}; +} namespace FillLightning { class Generator; diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 67450fb116..3376cc8883 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -903,7 +903,7 @@ indexed_triangle_set ModelObject::raw_indexed_triangle_set() const size_t j = out.indices.size(); append(out.vertices, v->mesh().its.vertices); append(out.indices, v->mesh().its.indices); - auto m = v->get_matrix(); + const Transform3d& m = v->get_matrix(); for (; i < out.vertices.size(); ++ i) out.vertices[i] = (m * out.vertices[i].cast()).cast().eval(); if (v->is_left_handed()) { diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 7a1cf206ea..14d063155b 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -817,7 +817,7 @@ private: this->set_material_id(other.material_id()); } // Providing a new mesh, therefore this volume will get a new unique ID assigned. - ModelVolume(ModelObject *object, const ModelVolume &other, const TriangleMesh &&mesh) : + ModelVolume(ModelObject *object, const ModelVolume &other, TriangleMesh &&mesh) : name(other.name), source(other.source), m_mesh(new TriangleMesh(std::move(mesh))), config(other.config), m_type(other.m_type), object(object), m_transformation(other.m_transformation) { assert(this->id().valid()); diff --git a/src/libslic3r/Point.hpp b/src/libslic3r/Point.hpp index 8985c76d85..ad814306f8 100644 --- a/src/libslic3r/Point.hpp +++ b/src/libslic3r/Point.hpp @@ -43,12 +43,10 @@ using Vec3i64 = Eigen::Matrix; // Vector types with a double coordinate base type. using Vec2f = Eigen::Matrix; using Vec3f = Eigen::Matrix; +using Vec4f = Eigen::Matrix; using Vec2d = Eigen::Matrix; using Vec3d = Eigen::Matrix; -#if ENABLE_GL_CORE_PROFILE -using Vec4f = Eigen::Matrix; using Vec4d = Eigen::Matrix; -#endif // ENABLE_GL_CORE_PROFILE using Points = std::vector; using PointPtrs = std::vector; diff --git a/src/libslic3r/Polygon.hpp b/src/libslic3r/Polygon.hpp index d245403392..0898205655 100644 --- a/src/libslic3r/Polygon.hpp +++ b/src/libslic3r/Polygon.hpp @@ -220,10 +220,10 @@ inline Polylines to_polylines(Polygons &&polys) Polylines polylines; polylines.assign(polys.size(), Polyline()); size_t idx = 0; - for (Polygons::const_iterator it = polys.begin(); it != polys.end(); ++ it) { + for (auto it = polys.begin(); it != polys.end(); ++ it) { Polyline &pl = polylines[idx ++]; pl.points = std::move(it->points); - pl.points.push_back(it->points.front()); + pl.points.push_back(pl.points.front()); } assert(idx == polylines.size()); return polylines; @@ -242,7 +242,7 @@ inline Polygons to_polygons(std::vector &&paths) { Polygons out; out.reserve(paths.size()); - for (const Points &path : paths) + for (Points &path : paths) out.emplace_back(std::move(path)); return out; } diff --git a/src/libslic3r/Polyline.hpp b/src/libslic3r/Polyline.hpp index 5766d9671b..256dca28cc 100644 --- a/src/libslic3r/Polyline.hpp +++ b/src/libslic3r/Polyline.hpp @@ -139,7 +139,7 @@ inline Polylines to_polylines(std::vector &&paths) { Polylines out; out.reserve(paths.size()); - for (const Points &path : paths) + for (Points &path : paths) out.emplace_back(std::move(path)); return out; } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 2e630b9c83..f3a1c15b3e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1498,7 +1498,7 @@ void PhysicalPrinter::update_preset_names_in_config() if (!preset_names.empty()) { std::vector& values = config.option("preset_names")->values; values.clear(); - for (auto preset : preset_names) + for (const std::string& preset : preset_names) values.push_back(preset); // temporary workaround for compatibility with older Slicer @@ -1571,7 +1571,7 @@ void PhysicalPrinter::set_name(const std::string& name) this->name = name; } -std::string PhysicalPrinter::get_full_name(std::string preset_name) const +std::string PhysicalPrinter::get_full_name(const std::string& preset_name) const { return name + separator() + preset_name; } @@ -1888,7 +1888,7 @@ std::vector PhysicalPrinterCollection::get_printers_with_only_prese { std::vector printers; - for (auto printer : m_printers) + for (const PhysicalPrinter& printer : m_printers) if (printer.preset_names.size() == 1 && *printer.preset_names.begin() == preset_name) printers.emplace_back(printer.name); diff --git a/src/libslic3r/Preset.hpp b/src/libslic3r/Preset.hpp index 25ae37484b..58ab57cfd2 100644 --- a/src/libslic3r/Preset.hpp +++ b/src/libslic3r/Preset.hpp @@ -675,7 +675,7 @@ public: bool operator<(const PhysicalPrinter& other) const { return this->name < other.name; } // get full printer name included a name of the preset - std::string get_full_name(std::string preset_name) const; + std::string get_full_name(const std::string &preset_name) const; // get printer name from the full name uncluded preset name static std::string get_short_name(std::string full_name); diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 874b775cd2..85bcd69ba5 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -267,7 +267,7 @@ PresetsConfigSubstitutions PresetBundle::load_presets(AppConfig &config, Forward std::string errors_cummulative; std::tie(substitutions, errors_cummulative) = this->load_system_presets(substitution_rule); - const std::string dir_user_presets = data_dir() + const std::string& dir_user_presets = data_dir() #ifdef SLIC3R_PROFILE_USE_PRESETS_SUBDIR // Store the print/filament/printer presets into a "presets" directory. + "/presets" diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 85246df315..c521393dff 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -885,9 +885,9 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor message = L("Generating G-code"); this->set_status(90, message); - // The following line may die for multiple reasons. - GCode gcode; - gcode.do_export(this, path.c_str(), result, thumbnail_cb); + // Create GCode on heap, it has quite a lot of data. + std::unique_ptr gcode(new GCode); + gcode->do_export(this, path.c_str(), result, thumbnail_cb); return path.c_str(); } diff --git a/src/libslic3r/Surface.hpp b/src/libslic3r/Surface.hpp index 4920efbbfd..ef1de30e95 100644 --- a/src/libslic3r/Surface.hpp +++ b/src/libslic3r/Surface.hpp @@ -58,11 +58,11 @@ public: thickness(rhs.thickness), thickness_layers(rhs.thickness_layers), bridge_angle(rhs.bridge_angle), extra_perimeters(rhs.extra_perimeters) {}; - Surface(SurfaceType _surface_type, const ExPolygon &&_expolygon) + Surface(SurfaceType _surface_type, ExPolygon &&_expolygon) : surface_type(_surface_type), expolygon(std::move(_expolygon)), thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0) {}; - Surface(const Surface &other, const ExPolygon &&_expolygon) + Surface(const Surface &other, ExPolygon &&_expolygon) : surface_type(other.surface_type), expolygon(std::move(_expolygon)), thickness(other.thickness), thickness_layers(other.thickness_layers), bridge_angle(other.bridge_angle), extra_perimeters(other.extra_perimeters) @@ -159,7 +159,7 @@ inline ExPolygons to_expolygons(Surfaces &&src) { ExPolygons expolygons; expolygons.reserve(src.size()); - for (Surfaces::const_iterator it = src.begin(); it != src.end(); ++it) + for (auto it = src.begin(); it != src.end(); ++it) expolygons.emplace_back(ExPolygon(std::move(it->expolygon))); src.clear(); return expolygons; @@ -260,8 +260,8 @@ inline void surfaces_append(Surfaces &dst, ExPolygons &&src, SurfaceType surface inline void surfaces_append(Surfaces &dst, ExPolygons &&src, const Surface &surfaceTempl) { dst.reserve(dst.size() + number_polygons(src)); - for (ExPolygons::const_iterator it = src.begin(); it != src.end(); ++ it) - dst.emplace_back(Surface(surfaceTempl, std::move(*it))); + for (ExPolygon& explg : src) + dst.emplace_back(Surface(surfaceTempl, std::move(explg))); src.clear(); } diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index e00b6e71c5..ddc9a4081f 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -961,9 +961,11 @@ std::string string_printf(const char *format, ...) buffer.resize(size_t(bufflen) + 1); ::vsnprintf(buffer.data(), buffer.size(), format, args2); } + + va_end(args1); + va_end(args2); buffer.resize(bufflen); - return buffer; } diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index d2f0e89aa0..760f5fe0a3 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -1084,7 +1084,7 @@ void Control::Ruler::update(const std::vector& values, double scroll_ste { if (!m_parent || values.empty() || // check if need to update ruler in respect to input values - values.front() == m_min_val && values.back() == m_max_val && m_scroll_step == scroll_step && max_values.size() == m_max_values_cnt) + (values.front() == m_min_val && values.back() == m_max_val && m_scroll_step == scroll_step && max_values.size() == m_max_values_cnt)) return; m_min_val = values.front(); diff --git a/src/slic3r/GUI/GLModel.cpp b/src/slic3r/GUI/GLModel.cpp index c84d4a512a..a2c9b54d7d 100644 --- a/src/slic3r/GUI/GLModel.cpp +++ b/src/slic3r/GUI/GLModel.cpp @@ -112,7 +112,6 @@ void GLModel::Geometry::add_vertex(const Vec3f& position, const Vec3f& normal) vertices.emplace_back(normal.z()); } -#if ENABLE_GL_CORE_PROFILE void GLModel::Geometry::add_vertex(const Vec4f& position) { assert(format.vertex_layout == EVertexLayout::P4); @@ -121,7 +120,6 @@ void GLModel::Geometry::add_vertex(const Vec4f& position) vertices.emplace_back(position.z()); vertices.emplace_back(position.w()); } -#endif // ENABLE_GL_CORE_PROFILE void GLModel::Geometry::add_index(unsigned int id) { @@ -209,7 +207,6 @@ Vec2f GLModel::Geometry::extract_tex_coord_2(size_t id) const return { *(start + 0), *(start + 1) }; } -#if ENABLE_LEGACY_OPENGL_REMOVAL void GLModel::Geometry::set_vertex(size_t id, const Vec3f& position, const Vec3f& normal) { assert(format.vertex_layout == EVertexLayout::P3N3); @@ -251,7 +248,6 @@ void GLModel::Geometry::remove_vertex(size_t id) vertices.erase(it, it + stride); } } -#endif // ENABLE_LEGACY_OPENGL_REMOVAL size_t GLModel::Geometry::vertex_stride_floats(const Format& format) { @@ -262,9 +258,7 @@ size_t GLModel::Geometry::vertex_stride_floats(const Format& format) case EVertexLayout::P3: { return 3; } case EVertexLayout::P3T2: { return 5; } case EVertexLayout::P3N3: { return 6; } -#if ENABLE_GL_CORE_PROFILE case EVertexLayout::P4: { return 4; } -#endif // ENABLE_GL_CORE_PROFILE default: { assert(false); return 0; } }; } @@ -278,9 +272,7 @@ size_t GLModel::Geometry::position_stride_floats(const Format& format) case EVertexLayout::P3: case EVertexLayout::P3T2: case EVertexLayout::P3N3: { return 3; } -#if ENABLE_GL_CORE_PROFILE case EVertexLayout::P4: { return 4; } -#endif // ENABLE_GL_CORE_PROFILE default: { assert(false); return 0; } }; } @@ -293,12 +285,8 @@ size_t GLModel::Geometry::position_offset_floats(const Format& format) case EVertexLayout::P2T2: case EVertexLayout::P3: case EVertexLayout::P3T2: -#if ENABLE_GL_CORE_PROFILE case EVertexLayout::P3N3: - case EVertexLayout::P4: { return 0; } -#else - case EVertexLayout::P3N3: { return 0; } -#endif // ENABLE_GL_CORE_PROFILE + case EVertexLayout::P4: { return 0; } default: { assert(false); return 0; } }; } @@ -360,12 +348,8 @@ bool GLModel::Geometry::has_position(const Format& format) case EVertexLayout::P2T2: case EVertexLayout::P3: case EVertexLayout::P3T2: -#if ENABLE_GL_CORE_PROFILE case EVertexLayout::P3N3: - case EVertexLayout::P4: { return true; } -#else - case EVertexLayout::P3N3: { return true; } -#endif // ENABLE_GL_CORE_PROFILE + case EVertexLayout::P4: { return true; } default: { assert(false); return false; } }; } @@ -377,12 +361,8 @@ bool GLModel::Geometry::has_normal(const Format& format) case EVertexLayout::P2: case EVertexLayout::P2T2: case EVertexLayout::P3: -#if ENABLE_GL_CORE_PROFILE case EVertexLayout::P3T2: - case EVertexLayout::P4: { return false; } -#else - case EVertexLayout::P3T2: { return false; } -#endif // ENABLE_GL_CORE_PROFILE + case EVertexLayout::P4: { return false; } case EVertexLayout::P3N3: { return true; } default: { assert(false); return false; } }; @@ -396,12 +376,8 @@ bool GLModel::Geometry::has_tex_coord(const Format& format) case EVertexLayout::P3T2: { return true; } case EVertexLayout::P2: case EVertexLayout::P3: -#if ENABLE_GL_CORE_PROFILE case EVertexLayout::P3N3: - case EVertexLayout::P4: { return false; } -#else - case EVertexLayout::P3N3: { return false; } -#endif // ENABLE_GL_CORE_PROFILE + case EVertexLayout::P4: { return false; } default: { assert(false); return false; } }; } diff --git a/src/slic3r/GUI/GLModel.hpp b/src/slic3r/GUI/GLModel.hpp index 60fb9ae189..64f0c67625 100644 --- a/src/slic3r/GUI/GLModel.hpp +++ b/src/slic3r/GUI/GLModel.hpp @@ -63,9 +63,7 @@ namespace GUI { P3, // position 3 floats P3T2, // position 3 floats + texture coords 2 floats P3N3, // position 3 floats + normal 3 floats -#if ENABLE_GL_CORE_PROFILE P4, // position 4 floats -#endif // ENABLE_GL_CORE_PROFILE }; enum class EIndexType : unsigned char @@ -88,17 +86,14 @@ namespace GUI { ColorRGBA color{ ColorRGBA::BLACK() }; void reserve_vertices(size_t vertices_count) { vertices.reserve(vertices_count * vertex_stride_floats(format)); } - void reserve_indices(size_t indices_count) { indices.reserve(indices_count * index_stride_bytes(*this)); } - + void reserve_indices(size_t indices_count) { indices.reserve(indices_count); } void add_vertex(const Vec2f& position); // EVertexLayout::P2 void add_vertex(const Vec2f& position, const Vec2f& tex_coord); // EVertexLayout::P2T2 void add_vertex(const Vec3f& position); // EVertexLayout::P3 void add_vertex(const Vec3f& position, const Vec2f& tex_coord); // EVertexLayout::P3T2 void add_vertex(const Vec3f& position, const Vec3f& normal); // EVertexLayout::P3N3 -#if ENABLE_GL_CORE_PROFILE void add_vertex(const Vec4f& position); // EVertexLayout::P4 -#endif // ENABLE_GL_CORE_PROFILE void set_vertex(size_t id, const Vec3f& position, const Vec3f& normal); // EVertexLayout::P3N3 diff --git a/src/slic3r/GUI/GLShader.cpp b/src/slic3r/GUI/GLShader.cpp index 1e0b8d24db..5146f03fc6 100644 --- a/src/slic3r/GUI/GLShader.cpp +++ b/src/slic3r/GUI/GLShader.cpp @@ -301,7 +301,6 @@ void GLShaderProgram::set_uniform(int id, const Matrix3f& value) const glsafe(::glUniformMatrix3fv(id, 1, GL_FALSE, static_cast(value.data()))); } -#if ENABLE_LEGACY_OPENGL_REMOVAL void GLShaderProgram::set_uniform(int id, const Matrix3d& value) const { set_uniform(id, (Matrix3f)value.cast()); @@ -317,9 +316,7 @@ void GLShaderProgram::set_uniform(int id, const Matrix4d& value) const { set_uniform(id, (Matrix4f)value.cast()); } -#endif // ENABLE_LEGACY_OPENGL_REMOVAL -#if ENABLE_GL_CORE_PROFILE void GLShaderProgram::set_uniform(int id, const Vec2f& value) const { if (id >= 0) @@ -330,7 +327,6 @@ void GLShaderProgram::set_uniform(int id, const Vec2d& value) const { set_uniform(id, static_cast(value.cast())); } -#endif // ENABLE_GL_CORE_PROFILE void GLShaderProgram::set_uniform(int id, const Vec3f& value) const { diff --git a/src/slic3r/GUI/GLShader.hpp b/src/slic3r/GUI/GLShader.hpp index 6ad4e01b3a..935daaaeaa 100644 --- a/src/slic3r/GUI/GLShader.hpp +++ b/src/slic3r/GUI/GLShader.hpp @@ -62,15 +62,11 @@ public: void set_uniform(const char* name, const Transform3f& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const Transform3d& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const Matrix3f& value) const { set_uniform(get_uniform_location(name), value); } -#if ENABLE_LEGACY_OPENGL_REMOVAL void set_uniform(const char* name, const Matrix3d& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const Matrix4f& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const Matrix4d& value) const { set_uniform(get_uniform_location(name), value); } -#endif // ENABLE_LEGACY_OPENGL_REMOVAL -#if ENABLE_GL_CORE_PROFILE void set_uniform(const char* name, const Vec2f& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const Vec2d& value) const { set_uniform(get_uniform_location(name), value); } -#endif // ENABLE_GL_CORE_PROFILE void set_uniform(const char* name, const Vec3f& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const Vec3d& value) const { set_uniform(get_uniform_location(name), value); } void set_uniform(const char* name, const ColorRGB& value) const { set_uniform(get_uniform_location(name), value); } @@ -91,15 +87,11 @@ public: void set_uniform(int id, const Transform3f& value) const; void set_uniform(int id, const Transform3d& value) const; void set_uniform(int id, const Matrix3f& value) const; -#if ENABLE_LEGACY_OPENGL_REMOVAL void set_uniform(int id, const Matrix3d& value) const; void set_uniform(int id, const Matrix4f& value) const; void set_uniform(int id, const Matrix4d& value) const; -#endif // ENABLE_LEGACY_OPENGL_REMOVAL -#if ENABLE_GL_CORE_PROFILE void set_uniform(int id, const Vec2f& value) const; void set_uniform(int id, const Vec2d& value) const; -#endif // ENABLE_GL_CORE_PROFILE void set_uniform(int id, const Vec3f& value) const; void set_uniform(int id, const Vec3d& value) const; void set_uniform(int id, const ColorRGB& value) const; diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 4c1ad0acfb..5886be0284 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -530,9 +530,6 @@ wxExecuteEnv get_appimage_exec_env() } // namespace void desktop_execute(const char* argv[]) { - if (sizeof(argv) == 0) - return; - // Check if we're running in an AppImage container, if so, we need to remove AppImage's env vars, // because they may mess up the environment expected by the file manager. // Mostly this is about LD_LIBRARY_PATH, but we remove a few more too for good measure. diff --git a/src/slic3r/GUI/MsgDialog.hpp b/src/slic3r/GUI/MsgDialog.hpp index 874629343f..4ccc90792a 100644 --- a/src/slic3r/GUI/MsgDialog.hpp +++ b/src/slic3r/GUI/MsgDialog.hpp @@ -160,8 +160,8 @@ public: // customization of the message box buttons virtual bool SetYesNoLabels(const wxMD::ButtonLabel& yes, const wxMD::ButtonLabel& no) { - DoSetCustomLabel(m_yes, yes); - DoSetCustomLabel(m_no, no); + DoSetCustomLabel(m_yes, yes, wxID_YES); + DoSetCustomLabel(m_no, no, wxID_NO); return true; } @@ -169,29 +169,29 @@ public: const wxMD::ButtonLabel& no, const wxMD::ButtonLabel& cancel) { - DoSetCustomLabel(m_yes, yes); - DoSetCustomLabel(m_no, no); - DoSetCustomLabel(m_cancel, cancel); + DoSetCustomLabel(m_yes, yes, wxID_YES); + DoSetCustomLabel(m_no, no, wxID_NO); + DoSetCustomLabel(m_cancel, cancel, wxID_CANCEL); return true; } virtual bool SetOKLabel(const wxMD::ButtonLabel& ok) { - DoSetCustomLabel(m_ok, ok); + DoSetCustomLabel(m_ok, ok, wxID_OK); return true; } virtual bool SetOKCancelLabels(const wxMD::ButtonLabel& ok, const wxMD::ButtonLabel& cancel) { - DoSetCustomLabel(m_ok, ok); - DoSetCustomLabel(m_cancel, cancel); + DoSetCustomLabel(m_ok, ok, wxID_OK); + DoSetCustomLabel(m_cancel, cancel, wxID_CANCEL); return true; } virtual bool SetHelpLabel(const wxMD::ButtonLabel& help) { - DoSetCustomLabel(m_help, help); + DoSetCustomLabel(m_help, help, wxID_HELP); return true; } // test if any custom labels were set @@ -230,9 +230,10 @@ protected: // the value to var with possibly some transformation (e.g. Cocoa version // currently uses this to remove any accelerators from the button strings // while GTK+ one handles stock items specifically here) - void DoSetCustomLabel(wxString& var, const wxMD::ButtonLabel& label) + void DoSetCustomLabel(wxString& var, const wxMD::ButtonLabel& label, wxWindowID btn_id) { var = label.GetAsString(); + SetButtonLabel(btn_id, var); } // these functions return the custom label or empty string and should be diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 59a90d4c46..4218c93933 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1692,6 +1692,7 @@ struct Plater::priv std::string act = wxGetApp().app_config->get(act_key); if (act.empty()) { RichMessageDialog dialog(mainframe, reason + "\n" + format_wxstr(_L("Do you want to save the changes to \"%1%\"?"), suggested_project_name), wxString(SLIC3R_APP_NAME), wxYES_NO | wxCANCEL); + dialog.SetYesNoLabels(_L("Save"), _L("Discard")); dialog.ShowCheckBox(_L("Remember my choice")); res = dialog.ShowModal(); if (res != wxID_CANCEL) diff --git a/src/slic3r/GUI/UpdateDialogs.cpp b/src/slic3r/GUI/UpdateDialogs.cpp index 0441e866f3..e8edd57988 100644 --- a/src/slic3r/GUI/UpdateDialogs.cpp +++ b/src/slic3r/GUI/UpdateDialogs.cpp @@ -207,7 +207,7 @@ bool AppUpdateDownloadDialog::run_after_download() const boost::filesystem::path AppUpdateDownloadDialog::get_download_path() const { - return std::move(boost::filesystem::path(txtctrl_path->GetValue().ToUTF8().data())); + return boost::filesystem::path(txtctrl_path->GetValue().ToUTF8().data()); } // MsgUpdateConfig