summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.h
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-01-19 09:26:56 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-01-19 09:26:56 +0000
commitb158c7d0fa0bec2ccf885d06a9f1855ca8b3c698 (patch)
tree501d2d77868709da599734aaa413e46f1d48c544 /src/smallmap_gui.h
parentbe62387e4412e15fe7238a1c90979fe119c0fdcf (diff)
downloadopenttd-b158c7d0fa0bec2ccf885d06a9f1855ca8b3c698.tar.xz
(svn r26266) -Fix [FS#5860]: Update smallmap overlay if player joins different company and make sure company masks are valid
Diffstat (limited to 'src/smallmap_gui.h')
-rw-r--r--src/smallmap_gui.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h
index 4b180f547..6652f83d8 100644
--- a/src/smallmap_gui.h
+++ b/src/smallmap_gui.h
@@ -13,6 +13,7 @@
#define SMALLMAP_GUI_H
#include "industry_type.h"
+#include "company_base.h"
#include "window_gui.h"
#include "strings_func.h"
#include "blitter/factory.hpp"
@@ -135,6 +136,16 @@ protected:
this->GetNumberRowsLegend(num_columns) * FONT_HEIGHT_SMALL;
}
+ /**
+ * Get a bitmask for company links to be displayed. Usually this will be
+ * the _local_company. Spectators get to see all companies' links.
+ * @return Company mask.
+ */
+ inline uint32 GetOverlayCompanyMask() const
+ {
+ return Company::IsValidID(_local_company) ? 1U << _local_company : 0xffffffff;
+ }
+
uint GetNumberRowsLegend(uint columns) const;
void SelectLegendItem(int click_pos, LegendAndColour *legend, int end_legend_item, int begin_legend_item = 0);
void SwitchMapType(SmallMapType map_type);