mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-26 00:45:35 +00:00
Codechange: use EnumBitSet for CargoTypes
This commit is contained in:
committed by
Peter Nelson
parent
962a550d1b
commit
c45aa3c9b6
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user