OpenTTD Source: src/smallmap_gui.cpp File Reference

OpenTTD Source 14.0-beta3

Data Structures | Macros | Enumerations | Functions | Variables
smallmap_gui.cpp File Reference
`#include "stdafx.h"`
`#include "core/backup_type.hpp"`
`#include "clear_map.h"`
`#include "industry.h"`
`#include "station_map.h"`
`#include "landscape.h"`
`#include "tree_map.h"`
`#include "viewport_func.h"`
`#include "town.h"`
`#include "tunnelbridge_map.h"`
`#include "core/endian_func.hpp"`
`#include "vehicle_base.h"`
`#include "sound_func.h"`
`#include "window_func.h"`
`#include "company_base.h"`
`#include "zoom_func.h"`
`#include "strings_func.h"`
`#include "blitter/factory.hpp"`
`#include "linkgraph/linkgraph_gui.h"`
`#include "widgets/smallmap_widget.h"`
`#include "timer/timer.h"`
`#include "timer/timer_window.h"`
`#include "smallmap_gui.h"`
`#include "table/strings.h"`
`#include <bitset>`
`#include "safeguards.h"`
`#include "table/heightmap_colours.h"`

Go to the source code of this file.

## Data Structures
struct | LegendAndColour
| Structure for holding relevant data for legends in small map. More...
struct | SmallMapColourScheme
| Colour scheme of the smallmap. More...
struct | AndOr
class | SmallMapWindow
| Class managing the smallmap window. More...
class | NWidgetSmallmapDisplay
| Custom container class for displaying smallmap with a vertically resizing legend panel. More...

## Macros
#define | MK(a, b) {a, b, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, false}
| Macro for ordinary entry of LegendAndColour.
#define | MC(col_break) {0, STR_TINY_BLACK_HEIGHT, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, col_break}
| Macro for a height legend entry with configurable colour.
#define | MO(a, b) {a, b, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, false}
| Macro for non-company owned property entry of LegendAndColour.
#define | MOEND() {0, 0, INVALID_INDUSTRYTYPE, 0, OWNER_NONE, true, true, false}
| Macro used for forcing a rebuild of the owner legend the first time it is used.
#define | MKEND() {0, STR_NULL, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, true, false}
| Macro for end of list marker in arrays of LegendAndColour.
#define | MS(a, b) {a, b, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, true}
| Macro for break marker in arrays of LegendAndColour. More...
#define | MKCOLOUR(x) TO_LE32X(x)
#define | MKCOLOUR_XXXX(x) (MKCOLOUR(0x01010101) * (uint)(x))
#define | MKCOLOUR_X0X0(x) (MKCOLOUR(0x01000100) * (uint)(x))
#define | MKCOLOUR_0X0X(x) (MKCOLOUR(0x00010001) * (uint)(x))
#define | MKCOLOUR_0XX0(x) (MKCOLOUR(0x00010100) * (uint)(x))
#define | MKCOLOUR_X00X(x) (MKCOLOUR(0x01000001) * (uint)(x))
#define | MKCOLOUR_XYXY(x, y) (MKCOLOUR_X0X0(x) | MKCOLOUR_0X0X(y))
#define | MKCOLOUR_XYYX(x, y) (MKCOLOUR_X00X(x) | MKCOLOUR_0XX0(y))
#define | MKCOLOUR_0000 MKCOLOUR_XXXX(0x00)
#define | MKCOLOUR_0FF0 MKCOLOUR_0XX0(0xFF)
#define | MKCOLOUR_F00F MKCOLOUR_X00X(0xFF)
#define | MKCOLOUR_FFFF MKCOLOUR_XXXX(0xFF)

## Enumerations
enum | SmallMapType : byte { SMT_CONTOUR, SMT_VEHICLES, SMT_INDUSTRY, SMT_LINKSTATS, SMT_ROUTES, SMT_VEGETATION, SMT_OWNER }
| Types of legends in the WID_SM_LEGEND widget.

## Functions
void | BuildIndustriesLegend ()
| Fills an array for the industries legends.
void | BuildLinkStatsLegend ()
| Populate legend table for the link stat view.
void | BuildLandLegend ()
| (Re)build the colour tables for the legends.
void | BuildOwnerLegend ()
| Completes the array for the owned property legend.
static uint32_t | ApplyMask (uint32_t colour, const AndOr *mask)
static uint32_t | GetSmallMapContoursPixels (TileIndex tile, TileType t)
| Return the colour a tile would be displayed with in the small map in mode "Contour". More...
static uint32_t | GetSmallMapVehiclesPixels (TileIndex, TileType t)
| Return the colour a tile would be displayed with in the small map in mode "Vehicles". More...
static uint32_t | GetSmallMapIndustriesPixels (TileIndex tile, TileType t)
| Return the colour a tile would be displayed with in the small map in mode "Industries". More...
static uint32_t | GetSmallMapRoutesPixels (TileIndex tile, TileType t)
| Return the colour a tile would be displayed with in the small map in mode "Routes". More...
static uint32_t | GetSmallMapLinkStatsPixels (TileIndex tile, TileType t)
| Return the colour a tile would be displayed with in the small map in mode "link stats". More...
static uint32_t | GetSmallMapVegetationPixels (TileIndex tile, TileType t)
| Return the colour a tile would be displayed with in the smallmap in mode "Vegetation". More...
uint32_t | GetSmallMapOwnerPixels (TileIndex tile, TileType t, IncludeHeightmap include_heightmap)
| Return the colour a tile would be displayed with in the small map in mode "Owner". More...
static std::unique_ptr< NWidgetBase > | SmallMapDisplay ()
void | ShowSmallMap ()
| Show the smallmap window.
bool | ScrollMainWindowTo (int x, int y, int z, bool instant)
| Scrolls the main window to given coordinates. More...
Point | GetSmallMapStationMiddle (const Window *w, const Station *st)
| Determine the middle of a station in the smallmap window. More...

## Variables
static int | _smallmap_industry_count
| Number of used industries.
static int | _smallmap_company_count
| Number of entries in the owner legend.
static int | _smallmap_cargo_count
| Number of cargos in the link stats legend.
static uint8_t | _linkstat_colours_in_legenda [] = {0, 1, 3, 5, 7, 9, 11}
| Link stat colours shown in legenda.
static const int | NUM_NO_COMPANY_ENTRIES = 4
| Number of entries in the owner legend that are not companies.
static LegendAndColour | _legend_land_contours []
| Legend text giving the colours to look for on the minimap. More...
static const LegendAndColour | _legend_vehicles []
static const LegendAndColour | _legend_routes []
static const LegendAndColour | _legend_vegetation []
static LegendAndColour | _legend_land_owners [NUM_NO_COMPANY_ENTRIES+MAX_COMPANIES+1]
static LegendAndColour | _legend_linkstats [NUM_CARGO+lengthof(_linkstat_colours_in_legenda)+1]
| Legend entries for the link stats view.
static LegendAndColour | _legend_from_industries [NUM_INDUSTRYTYPES+1]
| Allow room for all industries, plus a terminator entry This is required in order to have the industry slots all filled up.
static uint | _industry_to_list_pos [NUM_INDUSTRYTYPES]
| For connecting industry type to position in industries list(small map legend)
static bool | _smallmap_show_heightmap = false
| Show heightmap in industry and owner mode of smallmap window.
static IndustryType | _smallmap_industry_highlight = INVALID_INDUSTRYTYPE
| Highlight a specific industry type.
static bool | _smallmap_industry_highlight_state
| State of highlight blinking.
static uint | _company_to_list_pos [MAX_COMPANIES]
| For connecting company ID to position in owner list (small map legend)
static const LegendAndColour *const | _legend_table []
static SmallMapColourScheme | _heightmap_schemes []
| Available colour schemes for height maps. More...
static const AndOr | _smallmap_contours_andor []
| Colour masks for "Contour" and "Routes" modes. More...
static const AndOr | _smallmap_vehicles_andor []
| Colour masks for "Vehicles", "Industry", and "Vegetation" modes. More...
static const byte | _tiletype_importance []
| Mapping of tile type to importance of the tile (higher number means more interesting to show). More...
static const uint32_t | _vegetation_clear_bits []
static const byte | _vehicle_type_colours [6]
| Vehicle colours in #SMT_VEHICLES mode. More...
static constexpr NWidgetPart | _nested_smallmap_display []
| Widget parts of the smallmap display. More...
static constexpr NWidgetPart | _nested_smallmap_bar []
| Widget parts of the smallmap legend bar + image buttons.
static constexpr NWidgetPart | _nested_smallmap_widgets []
static WindowDesc | _smallmap_desc (__FILE__, __LINE__, WDP_AUTO, "smallmap", 484, 314, WC_SMALLMAP, WC_NONE, 0, std::begin(_nested_smallmap_widgets), std::end(_nested_smallmap_widgets))

## Detailed Description

GUI that shows a small map of the world with metadata like owner or height.

Definition in file smallmap_gui.cpp.

## Macro Definition Documentation

## ◆ MS

#define MS | ( |  | a,
|  |  | b
| ) |  | {a, b, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, true}

Macro for break marker in arrays of LegendAndColour.

It will have valid data, though

Definition at line 80 of file smallmap_gui.cpp.

## Function Documentation

## ◆ GetSmallMapContoursPixels()

static uint32_t GetSmallMapContoursPixels | ( | TileIndex | tile,
|  | TileType | t
| ) |  |
| inlinestatic

Return the colour a tile would be displayed with in the small map in mode "Contour".

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).

Returns
  The colour of tile in the small map in mode "Contour"

Definition at line 431 of file smallmap_gui.cpp.

References _heightmap_schemes, _settings_client, ClientSettings::gui, and GUISettings::smallmap_land_colour.

Referenced by GetSmallMapLinkStatsPixels().

## ◆ GetSmallMapIndustriesPixels()

static uint32_t GetSmallMapIndustriesPixels | ( | TileIndex | tile,
|  | TileType | t
| ) |  |
| inlinestatic

Return the colour a tile would be displayed with in the small map in mode "Industries".

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).

Returns
  The colour of tile in the small map in mode "Industries"

Definition at line 457 of file smallmap_gui.cpp.

References _heightmap_schemes, _settings_client, ClientSettings::gui, and GUISettings::smallmap_land_colour.

## ◆ GetSmallMapLinkStatsPixels()

static uint32_t GetSmallMapLinkStatsPixels | ( | TileIndex | tile,
|  | TileType | t
| ) |  |
| inlinestatic

Return the colour a tile would be displayed with in the small map in mode "link stats".

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).

Returns
  The colour of tile in the small map in mode "link stats"

Definition at line 526 of file smallmap_gui.cpp.

References _smallmap_show_heightmap, GetSmallMapContoursPixels(), and GetSmallMapRoutesPixels().

## ◆ GetSmallMapOwnerPixels()

uint32_t GetSmallMapOwnerPixels | ( | TileIndex | tile,
|  | TileType | t,
|  | IncludeHeightmap | include_heightmap
| ) |  |

Return the colour a tile would be displayed with in the small map in mode "Owner".

Note
  If include_heightmap is IH_NEVER, the return value can safely be used as a palette colour (by masking it to a uint8_t)

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).
  include_heightmap | Whether to return the heightmap/contour colour of this tile (instead of the default land tile colour)

Returns
  The colour of tile in the small map in mode "Owner"

Definition at line 582 of file smallmap_gui.cpp.

References MP_VOID.

## ◆ GetSmallMapRoutesPixels()

static uint32_t GetSmallMapRoutesPixels | ( | TileIndex | tile,
|  | TileType | t
| ) |  |
| inlinestatic

Return the colour a tile would be displayed with in the small map in mode "Routes".

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).

Returns
  The colour of tile in the small map in mode "Routes"

Definition at line 470 of file smallmap_gui.cpp.

References GetStationType(), and MP_STATION.

Referenced by GetSmallMapLinkStatsPixels().

## ◆ GetSmallMapStationMiddle()

Point GetSmallMapStationMiddle | ( | const Window * | w,
|  | const Station * | st
| ) |  |

Determine the middle of a station in the smallmap window.

Parameters

  st | The station we're looking for.

Returns
  Middle point of the station in the smallmap window.

Definition at line 2028 of file smallmap_gui.cpp.

## ◆ GetSmallMapVegetationPixels()

static uint32_t GetSmallMapVegetationPixels | ( | TileIndex | tile,
|  | TileType | t
| ) |  |
| inlinestatic

Return the colour a tile would be displayed with in the smallmap in mode "Vegetation".

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).

Returns
  The colour of tile in the smallmap in mode "Vegetation"

Definition at line 549 of file smallmap_gui.cpp.

References CLEAR_GRASS, GetClearDensity(), IsClearGround(), and MP_CLEAR.

## ◆ GetSmallMapVehiclesPixels()

static uint32_t GetSmallMapVehiclesPixels | ( | TileIndex | ,
|  | TileType | t
| ) |  |
| inlinestatic

Return the colour a tile would be displayed with in the small map in mode "Vehicles".

Parameters

  tile | The tile of which we would like to get the colour.
  t | Effective tile type of the tile (see SmallMapWindow::GetTileColours).

Returns
  The colour of tile in the small map in mode "Vehicles"

Definition at line 444 of file smallmap_gui.cpp.

References _heightmap_schemes, _settings_client, ClientSettings::gui, and GUISettings::smallmap_land_colour.

## ◆ ScrollMainWindowTo()

bool ScrollMainWindowTo | ( | int | x,
|  | int | y,
|  | int | z,
|  | bool | instant
| ) |  |

Scrolls the main window to given coordinates.

Parameters

  x | x coordinate
  y | y coordinate
  z | z coordinate; -1 to scroll to terrain height
  instant | scroll instantly (meaningful only when smooth_scrolling is active)

Returns
  did the viewport position change?

Definition at line 2007 of file smallmap_gui.cpp.

Referenced by ScrollMainWindowToTile().

## Variable Documentation

## ◆ _heightmap_schemes

SmallMapColourScheme _heightmap_schemes[]
| static

Initial value:
= {
{nullptr, _green_map_heights, lengthof(_green_map_heights), MKCOLOUR_XXXX(0x54)},
{nullptr, _dark_green_map_heights, lengthof(_dark_green_map_heights), MKCOLOUR_XXXX(0x62)},
{nullptr, _violet_map_heights, lengthof(_violet_map_heights), MKCOLOUR_XXXX(0x81)},
}

Available colour schemes for height maps.

Definition at line 283 of file smallmap_gui.cpp.

Referenced by BuildLandLegend(), GetSmallMapContoursPixels(), GetSmallMapIndustriesPixels(), GetSmallMapVehiclesPixels(), and SmallMapWindow::RebuildColourIndexIfNecessary().

## ◆ _legend_land_contours

LegendAndColour _legend_land_contours[]
| static

Initial value:
= {
MK(PC_BLACK, STR_SMALLMAP_LEGENDA_ROADS),
MK(PC_GREY, STR_SMALLMAP_LEGENDA_RAILROADS),
MK(PC_LIGHT_BLUE, STR_SMALLMAP_LEGENDA_STATIONS_AIRPORTS_DOCKS),
MK(PC_DARK_RED, STR_SMALLMAP_LEGENDA_BUILDINGS_INDUSTRIES),
MK(PC_WHITE, STR_SMALLMAP_LEGENDA_VEHICLES),
MC(true),
MC(false),
MC(false),
MC(false),
MC(false),
MC(false),
MC(true),
MC(false),
MC(false),
MC(false),
MC(false),
MC(false),
}

Legend text giving the colours to look for on the minimap.

Definition at line 83 of file smallmap_gui.cpp.

Referenced by BuildLandLegend().

## ◆ _legend_land_owners

LegendAndColour _legend_land_owners[NUM_NO_COMPANY_ENTRIES+MAX_COMPANIES+1]
| static

Initial value:
= {
MO(PC_WATER, STR_SMALLMAP_LEGENDA_WATER),
MO(0x00, STR_SMALLMAP_LEGENDA_NO_OWNER),
MO(PC_DARK_RED, STR_SMALLMAP_LEGENDA_TOWNS),
MO(PC_DARK_GREY, STR_SMALLMAP_LEGENDA_INDUSTRIES),
MOEND(),
}

Definition at line 149 of file smallmap_gui.cpp.

## ◆ _legend_routes

const LegendAndColour _legend_routes[]
| static

Initial value:
= {
MK(PC_BLACK, STR_SMALLMAP_LEGENDA_ROADS),
MK(PC_GREY, STR_SMALLMAP_LEGENDA_RAILROADS),
MK(PC_DARK_RED, STR_SMALLMAP_LEGENDA_BUILDINGS_INDUSTRIES),
MS(PC_VERY_DARK_BROWN, STR_SMALLMAP_LEGENDA_RAILROAD_STATION),
MK(PC_ORANGE, STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY),
MK(PC_YELLOW, STR_SMALLMAP_LEGENDA_BUS_STATION),
MK(PC_RED, STR_SMALLMAP_LEGENDA_AIRPORT_HELIPORT),
MK(PC_LIGHT_BLUE, STR_SMALLMAP_LEGENDA_DOCK),
}

Definition at line 119 of file smallmap_gui.cpp.

## ◆ _legend_table

const LegendAndColour* const _legend_table[]
| static

Initial value:
= {
_legend_land_contours,
_legend_vehicles,
_legend_from_industries,
_legend_linkstats,
_legend_routes,
_legend_vegetation,
_legend_land_owners,
}

Definition at line 246 of file smallmap_gui.cpp.

## ◆ _legend_vegetation

const LegendAndColour _legend_vegetation[]
| static

Initial value:
= {
MK(PC_ROUGH_LAND, STR_SMALLMAP_LEGENDA_ROUGH_LAND),
MK(PC_GRASS_LAND, STR_SMALLMAP_LEGENDA_GRASS_LAND),
MK(PC_BARE_LAND, STR_SMALLMAP_LEGENDA_BARE_LAND),
MK(PC_RAINFOREST, STR_SMALLMAP_LEGENDA_RAINFOREST),
MK(PC_FIELDS, STR_SMALLMAP_LEGENDA_FIELDS),
MK(PC_TREES, STR_SMALLMAP_LEGENDA_TREES),
MS(PC_GREEN, STR_SMALLMAP_LEGENDA_FOREST),
MK(PC_GREY, STR_SMALLMAP_LEGENDA_ROCKS),
MK(PC_ORANGE, STR_SMALLMAP_LEGENDA_DESERT),
MK(PC_LIGHT_BLUE, STR_SMALLMAP_LEGENDA_SNOW),
MK(PC_BLACK, STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES),
MK(PC_DARK_RED, STR_SMALLMAP_LEGENDA_BUILDINGS_INDUSTRIES),
}

Definition at line 132 of file smallmap_gui.cpp.

## ◆ _legend_vehicles

const LegendAndColour _legend_vehicles[]
| static

Initial value:
= {
MK(PC_RED, STR_SMALLMAP_LEGENDA_TRAINS),
MK(PC_YELLOW, STR_SMALLMAP_LEGENDA_ROAD_VEHICLES),
MK(PC_LIGHT_BLUE, STR_SMALLMAP_LEGENDA_SHIPS),
MK(PC_WHITE, STR_SMALLMAP_LEGENDA_AIRCRAFT),
MS(PC_BLACK, STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES),
MK(PC_DARK_RED, STR_SMALLMAP_LEGENDA_BUILDINGS_INDUSTRIES),
}

Definition at line 108 of file smallmap_gui.cpp.

## ◆ _nested_smallmap_display

constexpr NWidgetPart _nested_smallmap_display[]
| staticconstexpr

Initial value:
= {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SM_MAP_BORDER),
NWidget(WWT_INSET, COLOUR_BROWN, WID_SM_MAP), SetMinimalSize(346, 140), SetResize(1, 1), SetPadding(2, 2, 2, 2), EndContainer(),
EndContainer(),
}

Widget parts of the smallmap display.

Definition at line 1900 of file smallmap_gui.cpp.

## ◆ _nested_smallmap_widgets

constexpr NWidgetPart _nested_smallmap_widgets[]
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SM_CAPTION), SetDataTip(STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidgetFunction(SmallMapDisplay),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_SM_SELECT_BUTTONS),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_SM_ENABLE_ALL), SetDataTip(STR_SMALLMAP_ENABLE_ALL, STR_NULL),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_SM_DISABLE_ALL), SetDataTip(STR_SMALLMAP_DISABLE_ALL, STR_NULL),
NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_SM_SHOW_HEIGHT), SetDataTip(STR_SMALLMAP_SHOW_HEIGHT, STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT),
NWidget(WWT_PANEL, COLOUR_BROWN), SetFill(1, 0), SetResize(1, 0),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN), SetFill(1, 0), SetResize(1, 0),
EndContainer(),
EndContainer(),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(),
}

Definition at line 1958 of file smallmap_gui.cpp.

## ◆ _smallmap_contours_andor

const AndOr _smallmap_contours_andor[]
| static

Initial value:
= {
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_0XX0(PC_GREY ), MKCOLOUR_F00F},
{MKCOLOUR_0XX0(PC_BLACK ), MKCOLOUR_F00F},
{MKCOLOUR_0XX0(PC_DARK_RED ), MKCOLOUR_F00F},
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_XXXX(PC_LIGHT_BLUE), MKCOLOUR_0000},
{MKCOLOUR_XXXX(PC_WATER ), MKCOLOUR_0000},
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_XXXX(PC_DARK_RED ), MKCOLOUR_0000},
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_0XX0(PC_DARK_RED ), MKCOLOUR_F00F},
{MKCOLOUR_0XX0(PC_GREY ), MKCOLOUR_F00F},
}

Colour masks for "Contour" and "Routes" modes.

Definition at line 377 of file smallmap_gui.cpp.

## ◆ _smallmap_vehicles_andor

const AndOr _smallmap_vehicles_andor[]
| static

Initial value:
= {
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_0XX0(PC_BLACK ), MKCOLOUR_F00F},
{MKCOLOUR_0XX0(PC_BLACK ), MKCOLOUR_F00F},
{MKCOLOUR_0XX0(PC_DARK_RED ), MKCOLOUR_F00F},
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_0XX0(PC_BLACK ), MKCOLOUR_F00F},
{MKCOLOUR_XXXX(PC_WATER ), MKCOLOUR_0000},
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_XXXX(PC_DARK_RED ), MKCOLOUR_0000},
{MKCOLOUR_0000 , MKCOLOUR_FFFF},
{MKCOLOUR_0XX0(PC_DARK_RED ), MKCOLOUR_F00F},
{MKCOLOUR_0XX0(PC_BLACK ), MKCOLOUR_F00F},
}

Colour masks for "Vehicles", "Industry", and "Vegetation" modes.

Definition at line 393 of file smallmap_gui.cpp.

## ◆ _tiletype_importance

const byte _tiletype_importance[]
| static

Initial value:
= {
2,
8,
7,
5,
2,
9,
2,
1,
6,
8,
2,
0,
}

Mapping of tile type to importance of the tile (higher number means more interesting to show).

Definition at line 409 of file smallmap_gui.cpp.

## ◆ _vegetation_clear_bits

const uint32_t _vegetation_clear_bits[]
| static

Initial value:
= {
MKCOLOUR_XXXX(PC_GRASS_LAND),
MKCOLOUR_XXXX(PC_ROUGH_LAND),
MKCOLOUR_XXXX(PC_GREY),
MKCOLOUR_XXXX(PC_FIELDS),
MKCOLOUR_XXXX(PC_LIGHT_BLUE),
MKCOLOUR_XXXX(PC_ORANGE),
MKCOLOUR_XXXX(PC_GRASS_LAND),
MKCOLOUR_XXXX(PC_GRASS_LAND),
}

Definition at line 531 of file smallmap_gui.cpp.

## ◆ _vehicle_type_colours

const byte _vehicle_type_colours[6]
| static

Initial value:
= {
PC_RED, PC_YELLOW, PC_LIGHT_BLUE, PC_WHITE, PC_BLACK, PC_RED
}

Vehicle colours in #SMT_VEHICLES mode.

Indexed by VehicleType.

Definition at line 610 of file smallmap_gui.cpp.

SetFill
constexpr NWidgetPart SetFill(uint16_t fill_x, uint16_t fill_y)
Widget part function for setting filling.
Definition: widget_type.h:1141
PC_VERY_DARK_BROWN
static const uint8_t PC_VERY_DARK_BROWN
Almost-black brown palette colour.
Definition: palette_func.h:64
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:68
PC_RAINFOREST
static const uint8_t PC_RAINFOREST
Pale green palette colour for rainforest.
Definition: palette_func.h:81
MOEND
#define MOEND()
Macro used for forcing a rebuild of the owner legend the first time it is used.
Definition: smallmap_gui.cpp:71
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:63
PC_WHITE
static const uint8_t PC_WHITE
White palette colour.
Definition: palette_func.h:58
WWT_DEFSIZEBOX
@ WWT_DEFSIZEBOX
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX)
Definition: widget_type.h:67
MS
#define MS(a, b)
Macro for break marker in arrays of LegendAndColour.
Definition: smallmap_gui.cpp:80
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:77
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1151
NWidgetFunction
constexpr NWidgetPart NWidgetFunction(NWidgetFunctionType *func_ptr)
Obtain a nested widget (sub)tree from an external source.
Definition: widget_type.h:1279
WID_SM_ENABLE_ALL
@ WID_SM_ENABLE_ALL
Button to enable display of all legend entries.
Definition: smallmap_widget.h:32
PC_FIELDS
static const uint8_t PC_FIELDS
Light brown palette colour for fields.
Definition: palette_func.h:82
_dark_green_map_heights
static const uint32_t _dark_green_map_heights[]
Height map colours for the dark green colour scheme, ordered by height.
Definition: heightmap_colours.h:132
NC_EQUALSIZE
@ NC_EQUALSIZE
Value of the NCB_EQUALSIZE flag.
Definition: widget_type.h:508
SetPadding
constexpr NWidgetPart SetPadding(uint8_t top, uint8_t right, uint8_t bottom, uint8_t left)
Widget part function for setting additional space around a widget.
Definition: widget_type.h:1188
PC_GREEN
static const uint8_t PC_GREEN
Green palette colour.
Definition: palette_func.h:72
SetResize
constexpr NWidgetPart SetResize(int16_t dx, int16_t dy)
Widget part function for setting the resize step.
Definition: widget_type.h:1086
WID_SM_MAP_BORDER
@ WID_SM_MAP_BORDER
Border around the smallmap.
Definition: smallmap_widget.h:16
_legend_land_contours
static LegendAndColour _legend_land_contours[]
Legend text giving the colours to look for on the minimap.
Definition: smallmap_gui.cpp:83
WWT_PUSHTXTBTN
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition: widget_type.h:110
_legend_from_industries
static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES+1]
Allow room for all industries, plus a terminator entry This is required in order to have the industry...
Definition: smallmap_gui.cpp:171
WID_SM_SHOW_HEIGHT
@ WID_SM_SHOW_HEIGHT
Show heightmap toggle button.
Definition: smallmap_widget.h:34
MC
#define MC(col_break)
Macro for a height legend entry with configurable colour.
Definition: smallmap_gui.cpp:65
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1258
PC_GRASS_LAND
static const uint8_t PC_GRASS_LAND
Dark green palette colour for grass land.
Definition: palette_func.h:79
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:71
WWT_RESIZEBOX
@ WWT_RESIZEBOX
Resize box (normally at bottom-right of a window)
Definition: widget_type.h:70
MK
#define MK(a, b)
Macro for ordinary entry of LegendAndColour.
Definition: smallmap_gui.cpp:62
PC_YELLOW
static const uint8_t PC_YELLOW
Yellow palette colour.
Definition: palette_func.h:68
PC_DARK_RED
static const uint8_t PC_DARK_RED
Dark red palette colour.
Definition: palette_func.h:61
PC_TREES
static const uint8_t PC_TREES
Green palette colour for trees.
Definition: palette_func.h:83
WID_SM_MAP
@ WID_SM_MAP
Panel containing the smallmap.
Definition: smallmap_widget.h:17
PC_ORANGE
static const uint8_t PC_ORANGE
Orange palette colour.
Definition: palette_func.h:66
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:52
WID_SM_DISABLE_ALL
@ WID_SM_DISABLE_ALL
Button to disable display of all legend entries.
Definition: smallmap_widget.h:33
PC_GREY
static const uint8_t PC_GREY
Grey palette colour.
Definition: palette_func.h:57
PC_WATER
static const uint8_t PC_WATER
Dark blue palette colour for water.
Definition: palette_func.h:84
PC_BLACK
static const uint8_t PC_BLACK
Black palette colour.
Definition: palette_func.h:55
WWT_INSET
@ WWT_INSET
Pressed (inset) panel, most commonly used as combo box text area.
Definition: widget_type.h:53
_violet_map_heights
static const uint32_t _violet_map_heights[]
Height map colours for the violet colour scheme, ordered by height.
Definition: heightmap_colours.h:235
_legend_linkstats
static LegendAndColour _legend_linkstats[NUM_CARGO+lengthof(_linkstat_colours_in_legenda)+1]
Legend entries for the link stats view.
Definition: smallmap_gui.cpp:166
lengthof
#define lengthof(x)
Return the length of an fixed size array.
Definition: stdafx.h:300
SetMinimalSize
constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
Widget part function for setting the minimal size.
Definition: widget_type.h:1097
_green_map_heights
static const uint32_t _green_map_heights[]
Height map colours for the green colour scheme, ordered by height.
Definition: heightmap_colours.h:13
PC_ROUGH_LAND
static const uint8_t PC_ROUGH_LAND
Dark green palette colour for rough land.
Definition: palette_func.h:78
PC_RED
static const uint8_t PC_RED
Red palette colour.
Definition: palette_func.h:62
PC_DARK_GREY
static const uint8_t PC_DARK_GREY
Dark grey palette colour.
Definition: palette_func.h:56
WID_SM_SELECT_BUTTONS
@ WID_SM_SELECT_BUTTONS
Selection widget for the buttons present in some smallmap modes.
Definition: smallmap_widget.h:31
SetDataTip
constexpr NWidgetPart SetDataTip(uint32_t data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1162
NWID_SELECTION
@ NWID_SELECTION
Stacked widgets, only one visible at a time (eg in a panel with tabs).
Definition: widget_type.h:82
MO
#define MO(a, b)
Macro for non-company owned property entry of LegendAndColour.
Definition: smallmap_gui.cpp:68
PC_LIGHT_BLUE
static const uint8_t PC_LIGHT_BLUE
Light blue palette colour.
Definition: palette_func.h:76
WID_SM_CAPTION
@ WID_SM_CAPTION
Caption of the window.
Definition: smallmap_widget.h:15
WWT_TEXTBTN
@ WWT_TEXTBTN
(Toggle) Button with text
Definition: widget_type.h:57
PC_BARE_LAND
static const uint8_t PC_BARE_LAND
Brown palette colour for bare land.
Definition: palette_func.h:80
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:66