Codechange: use EnumBitSet for CargoTypes

This commit is contained in:
Peter Nelson
2026-04-21 17:13:31 +01:00
committed by Peter Nelson
parent 962a550d1b
commit c45aa3c9b6
55 changed files with 278 additions and 265 deletions
+3 -3
View File
@@ -1260,9 +1260,9 @@ protected:
*/
void SetOverlayCargoMask()
{
CargoTypes cargo_mask = 0;
CargoTypes cargo_mask{};
for (int i = 0; i != _smallmap_cargo_count; ++i) {
if (_legend_linkstats[i].show_on_map) SetBit(cargo_mask, _legend_linkstats[i].type);
if (_legend_linkstats[i].show_on_map) cargo_mask.Set(static_cast<CargoType>(_legend_linkstats[i].type));
}
this->overlay->SetCargoMask(cargo_mask);
}
@@ -1459,7 +1459,7 @@ public:
SmallMapWindow(WindowDesc &desc, int window_number) : Window(desc)
{
_smallmap_industry_highlight = IT_INVALID;
this->overlay = std::make_unique<LinkGraphOverlay>(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1);
this->overlay = std::make_unique<LinkGraphOverlay>(this, WID_SM_MAP, CargoTypes{}, this->GetOverlayCompanyMask(), 1);
this->CreateNestedTree();
this->LowerWidget(WID_SM_CONTOUR + this->map_type);