fix.修复宿舍计算hash崩溃的问题

This commit is contained in:
MistEO
2021-11-14 02:59:16 +08:00
parent 3a0ecee722
commit 773876fe2d
3 changed files with 2 additions and 20 deletions

View File

@@ -276,7 +276,6 @@ namespace asst
};
struct InfrastOperMoodInfo
{
std::string hash; // 干员部分立绘的hash作为唯一标识
InfrastSmileyInfo smiley;
double percentage = 0; // 心情进度条的百分比
Rect rect;

View File

@@ -12,12 +12,11 @@ bool asst::InfrastMoodImageAnalyzer::analyze()
mood_detect();
mood_analyze();
hash_calc();
selected_analyze();
working_analyze();
for (auto&& info : m_result) {
log.trace(info.hash, info.rect.to_string(),
log.trace(info.rect.to_string(),
"smiley:", (int)info.smiley.type, "mood:", info.percentage,
"selected:", info.selected, "working:", info.working);
}
@@ -48,7 +47,6 @@ bool asst::InfrastMoodImageAnalyzer::mood_detect()
const auto upper_task_ptr = resource.task().task_ptr("InfrastSkillsUpper");
const auto lower_task_ptr = resource.task().task_ptr("InfrastSkillsLower");
const auto prg_task_ptr = resource.task().task_ptr("InfrastOperMoodProgressBar");
Rect progress_rect_move = prg_task_ptr->rect_move;
std::vector<Rect> roi_vec = {
@@ -172,20 +170,6 @@ bool asst::InfrastMoodImageAnalyzer::mood_analyze()
return false;
}
bool asst::InfrastMoodImageAnalyzer::hash_calc()
{
const auto hash_task_ptr = resource.task().task_ptr("InfrastSkillsHash");
Rect hash_rect_move = hash_task_ptr->rect_move;
for (auto&& info : m_result) {
Rect hash_rect = hash_rect_move;
hash_rect.x += info.smiley.rect.x;
hash_rect.y += info.smiley.rect.y;
info.hash = calc_name_hash(hash_rect);
}
return true;
}
bool asst::InfrastMoodImageAnalyzer::selected_analyze()
{
const auto selected_task_ptr = std::dynamic_pointer_cast<MatchTaskInfo>(

View File

@@ -14,7 +14,7 @@ namespace asst
void sort_result();
const std::vector<InfrastOperMoodInfo>& get_result() const noexcept
auto get_result() const noexcept -> const std::vector<InfrastOperMoodInfo>&
{
return m_result;
}
@@ -32,7 +32,6 @@ namespace asst
bool mood_detect();
bool mood_analyze();
bool hash_calc();
bool selected_analyze();
bool working_analyze();