diff options
author | frosch <frosch@openttd.org> | 2015-05-09 09:24:19 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-05-09 09:24:19 +0000 |
commit | 5e47c27550efca4c318cfe4b9bdfe51a28bc2984 (patch) | |
tree | 23130a7f57190a80d78506bebff13d63c84218b2 /src/smallmap_gui.cpp | |
parent | 6dee48e018e3f4b3104f9a9160172079635c264c (diff) | |
download | openttd-5e47c27550efca4c318cfe4b9bdfe51a28bc2984.tar.xz |
(svn r27277) -Codechange: Make _displayed_industries a std::bitset.
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r-- | src/smallmap_gui.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index ef0f4dd0f..80d4ae2a8 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -28,6 +28,8 @@ #include "table/strings.h" +#include <bitset> + #include "safeguards.h" static int _smallmap_industry_count; ///< Number of used industries @@ -175,7 +177,7 @@ void BuildIndustriesLegend() uint j = 0; /* Add each name */ - for (uint8 i = 0; i < NUM_INDUSTRYTYPES; i++) { + for (uint i = 0; i < NUM_INDUSTRYTYPES; i++) { IndustryType ind = _sorted_industry_types[i]; const IndustrySpec *indsp = GetIndustrySpec(ind); if (indsp->enabled) { @@ -1507,11 +1509,11 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) break; case 0: { - extern uint64 _displayed_industries; + extern std::bitset<NUM_INDUSTRYTYPES> _displayed_industries; if (this->map_type != SMT_INDUSTRY) this->SwitchMapType(SMT_INDUSTRY); for (int i = 0; i != _smallmap_industry_count; i++) { - _legend_from_industries[i].show_on_map = HasBit(_displayed_industries, _legend_from_industries[i].type); + _legend_from_industries[i].show_on_map = _displayed_industries.test(_legend_from_industries[i].type); } break; } |