Merge. Squash feature/drops

This commit is contained in:
MistEO
2022-05-18 01:24:25 +08:00
parent 7e03b09691
commit f160b8eea2
532 changed files with 2554 additions and 29481 deletions

View File

@@ -6,13 +6,9 @@
#include "Logger.hpp"
void asst::TemplResource::append_load_required(std::unordered_set<std::string> required) noexcept
void asst::TemplResource::set_load_required(std::unordered_set<std::string> required) noexcept
{
LogTraceFunction;
m_templs_filename.insert(
std::make_move_iterator(required.begin()),
std::make_move_iterator(required.end()));
m_templs_filename = std::move(required);
}
bool asst::TemplResource::load(const std::string& dir)
@@ -20,16 +16,19 @@ bool asst::TemplResource::load(const std::string& dir)
LogTraceFunction;
for (const std::string& filename : m_templs_filename) {
std::string filepath = dir + "/" + filename;
std::filesystem::path filepath(dir + "/" + filename);
if (!filepath.has_extension()) {
filepath.replace_extension(".png");
}
if (std::filesystem::exists(filepath)) {
cv::Mat templ = cv::imread(filepath);
cv::Mat templ = cv::imread(filepath.string());
emplace_templ(filename, std::move(templ));
}
else if (m_loaded) {
continue;
}
else {
m_last_error = filepath + " not exists";
m_last_error = filepath.string() + " not exists";
return false;
}
}