Shapes Gallery :

- Suppress to create a PNG-files for system shapes
 - Allow to load the OBJ files
This commit is contained in:
YuSanka 2021-08-02 14:59:36 +02:00
parent bad51cdb52
commit e8e3279511
5 changed files with 61 additions and 32 deletions

View file

@ -100,8 +100,8 @@ extern bool is_ini_file(const boost::filesystem::directory_entry &path);
extern bool is_idx_file(const boost::filesystem::directory_entry &path);
extern bool is_gcode_file(const std::string &path);
extern bool is_img_file(const std::string& path);
extern bool is_stl_file(const boost::filesystem::directory_entry& path);
extern bool is_stl_file(const std::string& path);
extern bool is_gallery_file(const boost::filesystem::directory_entry& path, char const* type);
extern bool is_gallery_file(const std::string& path, char const* type);
extern bool is_shapes_dir(const std::string& dir);
// File path / name / extension splitting utilities, working with UTF-8,

View file

@ -766,14 +766,14 @@ bool is_img_file(const std::string &path)
return boost::iends_with(path, ".png") || boost::iends_with(path, ".svg");
}
bool is_stl_file(const boost::filesystem::directory_entry& dir_entry)
bool is_gallery_file(const boost::filesystem::directory_entry& dir_entry, char const* type)
{
return is_plain_file(dir_entry) && strcasecmp(dir_entry.path().extension().string().c_str(), ".stl") == 0;
return is_plain_file(dir_entry) && strcasecmp(dir_entry.path().extension().string().c_str(), type) == 0;
}
bool is_stl_file(const std::string &path)
bool is_gallery_file(const std::string &path, char const* type)
{
return boost::iends_with(path, ".stl");
return boost::iends_with(path, type);
}
bool is_shapes_dir(const std::string& dir)