Data Structures | Defines | Enumerations | Functions | Variables

smallmap_gui.cpp File Reference

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

#include "stdafx.h"
#include "clear_map.h"
#include "industry.h"
#include "station_map.h"
#include "landscape.h"
#include "window_gui.h"
#include "tree_map.h"
#include "viewport_func.h"
#include "town.h"
#include "blitter/factory.hpp"
#include "tunnelbridge_map.h"
#include "strings_func.h"
#include "core/endian_func.hpp"
#include "vehicle_base.h"
#include "sound_func.h"
#include "window_func.h"
#include "company_base.h"
#include "company_func.h"
#include "station_base.h"
#include "table/strings.h"
#include <vector>

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...
struct  SmallMapWindow::VehicleAndPosition
 Save the Vehicle's old position here, so that we don't get glitches when redrawing. More...
struct  SmallMapWindow::BaseCargoDetail
struct  SmallMapWindow::CargoDetail
struct  SmallMapWindow::LinkDetails
class  SmallMapWindow::LinkDrawer
class  SmallMapWindow::LinkLineDrawer
class  SmallMapWindow::LinkValueDrawer
class  SmallMapWindow::LinkTextDrawer
class  SmallMapWindow::LinkGraphDrawer
class  NWidgetSmallmapDisplay
 Custom container class for displaying smallmap with a vertically resizing legend panel. More...

Defines

#define MK(a, b)   {a, b, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, false}
 Macro for ordinary entry of LegendAndColour.
#define MC(height)   {0, STR_TINY_BLACK_HEIGHT, INVALID_INDUSTRYTYPE, height, INVALID_COMPANY, true, false, false}
 Macro for a height legend entry with configurable colour.
#define MS(a, b)   {a, b, INVALID_INDUSTRYTYPE, 0, INVALID_COMPANY, true, false, true}
 Macro for break marker in arrays of LegendAndColour.
#define MCS(height)   {0, STR_TINY_BLACK_HEIGHT, INVALID_INDUSTRYTYPE, height, INVALID_COMPANY, true, false, true}
 Macro for a height legend break marker 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 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  SmallMapWindowWidgets {
  SM_WIDGET_CAPTION, SM_WIDGET_MAP_BORDER, SM_WIDGET_MAP, SM_WIDGET_LEGEND,
  SM_WIDGET_BLANK, SM_WIDGET_ZOOM_IN, SM_WIDGET_ZOOM_OUT, SM_WIDGET_CONTOUR,
  SM_WIDGET_VEHICLES, SM_WIDGET_INDUSTRIES, SM_WIDGET_LINKSTATS, SM_WIDGET_ROUTES,
  SM_WIDGET_VEGETATION, SM_WIDGET_OWNERS, SM_WIDGET_CENTERMAP, SM_WIDGET_TOGGLETOWNNAME,
  SM_WIDGET_SELECT_BUTTONS, SM_WIDGET_ENABLE_ALL, SM_WIDGET_DISABLE_ALL, SM_WIDGET_SHOW_HEIGHT
}
 

Widget numbers of the small map window.

More...
enum  SmallMapStats {
  STAT_CAPACITY, STAT_BEGIN = STAT_CAPACITY, STAT_USAGE, STAT_PLANNED,
  STAT_SENT, STAT_TEXT, STAT_GRAPH, STAT_END,
  NUM_STATS = STAT_END
}

Functions

void BuildIndustriesLegend ()
 Fills an array for the industries legends.
void BuildLinkStatsLegend ()
 Populate legend table for the link stat view.
 assert_compile (lengthof(_green_map_heights_old)==MAX_TILE_HEIGHT_OLD+2)
 assert_compile (lengthof(_green_map_heights_extended)==MAX_TILE_HEIGHT_EXTENDED+2)
 assert_compile (lengthof(_dark_green_map_heights_old)==MAX_TILE_HEIGHT_OLD+2)
 assert_compile (lengthof(_dark_green_map_heights_extended)==MAX_TILE_HEIGHT_EXTENDED+2)
 assert_compile (lengthof(_violet_map_heights_old)==MAX_TILE_HEIGHT_OLD+2)
 assert_compile (lengthof(_violet_map_heights_extended)==MAX_TILE_HEIGHT_EXTENDED+2)
 assert_compile (lengthof(_stuck_counter_colours)==8)
void BuildLandLegend ()
 (Re)build the colour tables for the legends.
void BuildOwnerLegend ()
 Completes the array for the owned property legend.
static uint32 ApplyMask (uint32 colour, const AndOr *mask)
static TileType GetEffectiveTileType (TileIndex tile)
static uint32 GetSmallMapContoursPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "Contour".
static uint32 GetSmallMapVehiclesPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "Vehicles".
static uint32 GetSmallMapIndustriesPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "Industries".
static uint32 GetSmallMapStuckRoutesPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "Routes".
static uint32 GetSmallMapRoutesPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "link stats" while showing height is disabled.
static uint32 GetSmallMapLinkStatsPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "link stats".
static uint32 GetSmallMapVegetationPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the smallmap in mode "Vegetation".
static uint32 GetSmallMapOwnerPixels (TileIndex tile, TileType t)
 Return the colour a tile would be displayed with in the small map in mode "Owner".
static Point TileCoordFromScreenCoord (int x, int y)
void DrawVertex (int x, int y, int size, int colour, int border_colour)
 Draw a square symbolizing a producer of cargo in the link stats view.
static NWidgetBaseSmallMapDisplay (int *biggest_index)
void ShowSmallMap ()
 Show the smallmap window.
bool ScrollMainWindowTo (int x, int y, int z, bool instant)
 Scrolls the main window to given coordinates.

Variables

static int _smallmap_industry_count
 Number of used industries.
static int _smallmap_company_count
 Number of entries in the owner legend.
static const int NUM_NO_COMPANY_ENTRIES = 4
 Number of entries in the owner legend that are not companies.
static int _smallmap_cargo_count
 number of cargos in the link stats legend
static const uint8 PC_ROUGH_LAND = 0x52
 Dark green palette colour for rough land.
static const uint8 PC_GRASS_LAND = 0x54
 Dark green palette colour for grass land.
static const uint8 PC_BARE_LAND = 0x37
 Brown palette colour for bare land.
static const uint8 PC_FIELDS = 0x25
 Light brown palette colour for fields.
static const uint8 PC_TREES = 0x57
 Green palette colour for trees.
static const uint8 PC_WATER = 0xCA
 Dark blue palette colour for water.
static LegendAndColour _legend_land_contours_old []
 Legend text giving the colours to look for on the minimap (original).
static LegendAndColour _legend_land_contours_extended []
 Legend text giving the colours to look for on the minimap (in case of AllowMoreHeightlevels()).
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_from_industries [NUM_INDUSTRYTYPES+1]
 Allow room for all industries, plus a terminator entry This is required in order to have the indutry 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 uint _company_to_list_pos [MAX_COMPANIES]
 For connecting company ID to position in owner list (small map legend).
static LegendAndColour _legend_linkstats [NUM_CARGO+NUM_STATS+1]
static const LegendAndColour *const _legend_table_old []
static const LegendAndColour *const _legend_table_extended []
static const uint32 _green_map_heights_old []
 Colour array for displaying elevation in the smallmap, ordered by height.
static const uint32 _green_map_heights_extended []
 Height map colours for the green colour scheme, ordered by height.
static const uint32 _dark_green_map_heights_old []
 Height map colours for the dark green colour scheme, ordered by height.
static const uint32 _dark_green_map_heights_extended []
 Height map colours for the dark green colour scheme, ordered by height.
static const uint32 _violet_map_heights_old []
 Height map colours for the violet colour scheme, ordered by height.
static const uint32 _violet_map_heights_extended []
 Height map colours for the violet colour scheme, ordered by height.
static const uint32 _stuck_counter_colours []
 Colour Coding for Stuck Counter.
static const SmallMapColourScheme _heightmap_schemes_old []
 Available colour schemes for height maps.
static const SmallMapColourScheme _heightmap_schemes_extended []
 Available colour schemes for height maps.
static const AndOr _smallmap_contours_andor []
 Colour masks for "Contour" and "Routes" modes.
static const AndOr _smallmap_vehicles_andor []
 Colour masks for "Vehicles", "Industry", and "Vegetation" modes.
static const byte _tiletype_importance []
 Mapping of tile type to importance of the tile (higher number means more interesting to show).
static const uint32 _vegetation_clear_bits []
static const byte _vehicle_type_colours [6]
 Vehicle colours in SMT_VEHICLES mode.
static const NWidgetPart _nested_smallmap_display []
 Widget parts of the smallmap display.
static const NWidgetPart _nested_smallmap_bar []
 Widget parts of the smallmap legend bar + image buttons.
static const NWidgetPart _nested_smallmap_widgets []
static const WindowDesc _smallmap_desc (WDP_AUTO, 484, 314, WC_SMALLMAP, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_smallmap_widgets, lengthof(_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.


Define Documentation

#define MC (   height  )     {0, STR_TINY_BLACK_HEIGHT, INVALID_INDUSTRYTYPE, height, INVALID_COMPANY, true, false, false}

Macro for a height legend entry with configurable colour.

Definition at line 91 of file smallmap_gui.cpp.

#define MCS (   height  )     {0, STR_TINY_BLACK_HEIGHT, INVALID_INDUSTRYTYPE, height, INVALID_COMPANY, true, false, true}

Macro for a height legend break marker entry with configurable colour.

Definition at line 100 of file smallmap_gui.cpp.

#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.

Definition at line 106 of file smallmap_gui.cpp.

#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 97 of file smallmap_gui.cpp.


Enumeration Type Documentation

Widget numbers of the small map window.

Enumerator:
SM_WIDGET_CAPTION 

Caption widget.

SM_WIDGET_MAP_BORDER 

Border around the smallmap.

SM_WIDGET_MAP 

Panel containing the smallmap.

SM_WIDGET_LEGEND 

Bottom panel to display smallmap legends.

SM_WIDGET_BLANK 

Empty button as placeholder.

SM_WIDGET_ZOOM_IN 

Button to zoom in one step.

SM_WIDGET_ZOOM_OUT 

Button to zoom out one step.

SM_WIDGET_CONTOUR 

Button to select the contour view (height map).

SM_WIDGET_VEHICLES 

Button to select the vehicles view.

SM_WIDGET_INDUSTRIES 

Button to select the industries view.

SM_WIDGET_LINKSTATS 

Button to select the link stats view.

SM_WIDGET_ROUTES 

Button to select the routes view.

SM_WIDGET_VEGETATION 

Button to select the vegetation view.

SM_WIDGET_OWNERS 

Button to select the owners view.

SM_WIDGET_CENTERMAP 

Button to move smallmap center to main window center.

SM_WIDGET_TOGGLETOWNNAME 

Toggle button to display town names.

SM_WIDGET_SELECT_BUTTONS 

Selection widget for the buttons present in some smallmap modes.

SM_WIDGET_ENABLE_ALL 

Button to enable display of all toggable legend entries.

SM_WIDGET_DISABLE_ALL 

Button to disable display of all toggable legend entries.

SM_WIDGET_SHOW_HEIGHT 

Show heightmap toggle button.

Definition at line 40 of file smallmap_gui.cpp.


Function Documentation

void DrawVertex ( int  x,
int  y,
int  size,
int  colour,
int  border_colour 
)

Draw a square symbolizing a producer of cargo in the link stats view.

Parameters:
x the x coordinate of the middle of the vertex
y the y coordinate of the middle of the vertex
size the x and y extend of the vertex
colour the colour with which the vertex will be filled
border_colour the colour for the border of the vertex

Definition at line 1806 of file smallmap_gui.cpp.

References GfxFillRect().

static uint32 GetSmallMapContoursPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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 GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "Contour"

Definition at line 1478 of file smallmap_gui.cpp.

References _green_map_heights_old, _settings_client, AllowMoreHeightlevels(), ClientSettings::gui, GUISettings::smallmap_flood_warning, GUISettings::smallmap_land_colour, and TileHeight().

Referenced by GetSmallMapLinkStatsPixels(), and SmallMapWindow::GetTileColours().

static uint32 GetSmallMapIndustriesPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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 GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "Industries"

Definition at line 1552 of file smallmap_gui.cpp.

References _green_map_heights_old, _industry_to_list_pos, _settings_client, _smallmap_show_heightmap, AllowMoreHeightlevels(), Industry::GetByTile(), GetIndustrySpec(), ClientSettings::gui, IsTileOnWater(), IndustrySpec::map_colour, MP_INDUSTRY, MP_WATER, GUISettings::smallmap_flood_warning, GUISettings::smallmap_land_colour, and TileHeight().

Referenced by SmallMapWindow::GetTileColours().

static uint32 GetSmallMapLinkStatsPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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 GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "link stats"

Definition at line 1693 of file smallmap_gui.cpp.

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

Referenced by SmallMapWindow::GetTileColours().

static uint32 GetSmallMapOwnerPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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

Parameters:
tile The tile of which we would like to get the colour.
t Effective tile type of the tile (see GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "Owner"

Definition at line 1743 of file smallmap_gui.cpp.

References _company_to_list_pos, _settings_client, _smallmap_show_heightmap, AllowMoreHeightlevels(), SmallMapColourScheme::default_colour, GetTileOwner(), ClientSettings::gui, SmallMapColourScheme::height_colours, MAX_COMPANIES, MP_HOUSE, MP_INDUSTRY, MP_WATER, OWNER_NONE, OWNER_TOWN, OWNER_WATER, PC_DARK_GREY, PC_DARK_RED, PC_WATER, GUISettings::smallmap_flood_warning, GUISettings::smallmap_land_colour, and TileHeight().

Referenced by SmallMapWindow::GetTileColours().

static uint32 GetSmallMapRoutesPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

Return the colour a tile would be displayed with in the small map in mode "link stats" while showing height is disabled.

Parameters:
tile The tile of which we would like to get the colour.
t Effective tile type of the tile (see GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "Routes"

Definition at line 1650 of file smallmap_gui.cpp.

References _settings_client, AllowMoreHeightlevels(), SmallMapColourScheme::default_colour, GetRailType(), GetRailTypeInfo(), GetStationType(), ClientSettings::gui, MP_RAILWAY, MP_STATION, PC_LIGHT_BLUE, PC_ORANGE, PC_RED, PC_VERY_DARK_BROWN, PC_YELLOW, and GUISettings::smallmap_land_colour.

Referenced by GetSmallMapLinkStatsPixels().

static uint32 GetSmallMapStuckRoutesPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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 GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "Routes"

Definition at line 1616 of file smallmap_gui.cpp.

References _settings_client, AllowMoreHeightlevels(), SmallMapColourScheme::default_colour, GetStationType(), ClientSettings::gui, MP_RAILWAY, MP_STATION, and GUISettings::smallmap_land_colour.

Referenced by SmallMapWindow::GetTileColours().

static uint32 GetSmallMapVegetationPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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 GetEffectiveTileType).
Returns:
The colour of tile in the smallmap in mode "Vegetation"

Definition at line 1716 of file smallmap_gui.cpp.

References _settings_game, CHECK_FOREST, IndustrySpec::check_proc, CLEAR_GRASS, GameSettings::game_creation, Industry::GetByTile(), GetClearDensity(), GetClearGround(), GetIndustrySpec(), GetTreeGround(), IsClearGround(), GameCreationSettings::landscape, MP_CLEAR, MP_INDUSTRY, MP_TREES, PC_BARE_LAND, PC_DARK_RED, PC_GRASS_LAND, PC_GREEN, PC_LIGHT_BLUE, PC_ORANGE, PC_TREES, TREE_GROUND_ROUGH_SNOW, and TREE_GROUND_SNOW_DESERT.

Referenced by SmallMapWindow::GetTileColours().

static uint32 GetSmallMapVehiclesPixels ( TileIndex  tile,
TileType  t 
) [inline, static]

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 GetEffectiveTileType).
Returns:
The colour of tile in the small map in mode "Vehicles"

Definition at line 1534 of file smallmap_gui.cpp.

References _settings_client, AllowMoreHeightlevels(), SmallMapColourScheme::default_colour, ClientSettings::gui, and GUISettings::smallmap_land_colour.

Referenced by SmallMapWindow::GetTileColours().

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 3951 of file smallmap_gui.cpp.

References FindWindowById(), and ScrollWindowTo().

Referenced by HandleViewportScroll(), VehicleViewWindow::OnClick(), NewsWindow::OnClick(), MainWindow::OnKeyPress(), and ScrollMainWindowToTile().


Variable Documentation

const uint32 _dark_green_map_heights_extended[] [static]

Height map colours for the dark green colour scheme, ordered by height.

Used when AllowMoreHeightlevels() is true. For the moment the aray is extended to 256 levels.

Definition at line 702 of file smallmap_gui.cpp.

const uint32 _dark_green_map_heights_old[] [static]
Initial value:
 {
  MKCOLOUR(0x04dcdcdc), 
  MKCOLOUR_XXXX(0x60),
  MKCOLOUR_XYXY(0x60, 0x61),
  MKCOLOUR_XXXX(0x61),
  MKCOLOUR_XYXY(0x61, 0x62),
  MKCOLOUR_XXXX(0x62),
  MKCOLOUR_XYXY(0x62, 0x63),
  MKCOLOUR_XXXX(0x63),
  MKCOLOUR_XYXY(0x63, 0x64),
  MKCOLOUR_XXXX(0x64),
  MKCOLOUR_XYXY(0x64, 0x65),
  MKCOLOUR_XXXX(0x65),
  MKCOLOUR_XYXY(0x65, 0x66),
  MKCOLOUR_XXXX(0x66),
  MKCOLOUR_XYXY(0x66, 0x67),
  MKCOLOUR_XXXX(0x67),
  MKCOLOUR_XXXX(0x67),
}

Height map colours for the dark green colour scheme, ordered by height.

This is the original array for use when AllowMoreHeightlevels() is false.

Definition at line 676 of file smallmap_gui.cpp.

const uint32 _green_map_heights_extended[] [static]

Height map colours for the green colour scheme, ordered by height.

Used when AllowMoreHeightlevels() is true. For the moment the aray is extended to 256 levels.

Definition at line 403 of file smallmap_gui.cpp.

const uint32 _green_map_heights_old[] [static]
Initial value:
 {
  MKCOLOUR(0x04dcdcdc), 
  MKCOLOUR_XXXX(0x5A),
  MKCOLOUR_XYXY(0x5A, 0x5B),
  MKCOLOUR_XXXX(0x5B),
  MKCOLOUR_XYXY(0x5B, 0x5C),
  MKCOLOUR_XXXX(0x5C),
  MKCOLOUR_XYXY(0x5C, 0x5D),
  MKCOLOUR_XXXX(0x5D),
  MKCOLOUR_XYXY(0x5D, 0x5E),
  MKCOLOUR_XXXX(0x5E),
  MKCOLOUR_XYXY(0x5E, 0x5F),
  MKCOLOUR_XXXX(0x5F),
  MKCOLOUR_XYXY(0x5F, 0x1F),
  MKCOLOUR_XXXX(0x1F),
  MKCOLOUR_XYXY(0x1F, 0x27),
  MKCOLOUR_XXXX(0x27),
  MKCOLOUR_XXXX(0x27),
}

Colour array for displaying elevation in the smallmap, ordered by height.

This is the original array for use when AllowMoreHeightlevels() is false.

Definition at line 377 of file smallmap_gui.cpp.

Referenced by GetSmallMapContoursPixels(), and GetSmallMapIndustriesPixels().

Initial value:
 {
  {_green_map_heights_extended,      MKCOLOUR(0x54545454)}, 
  {_dark_green_map_heights_extended, MKCOLOUR(0x62626262)}, 
  {_violet_map_heights_extended,     MKCOLOUR(0x82828282)}, 
}

Available colour schemes for height maps.

(in case of AllowMoreHeightlevels() )

Definition at line 1345 of file smallmap_gui.cpp.

Initial value:
 {
  {_green_map_heights_old,      MKCOLOUR_XXXX(0x54)}, 
  {_dark_green_map_heights_old, MKCOLOUR_XXXX(0x62)}, 
  {_violet_map_heights_old,     MKCOLOUR_XXXX(0x82)}, 
}

Available colour schemes for height maps.

(original)

Definition at line 1338 of file smallmap_gui.cpp.

Initial value:
 {
  
  MC(1),
  MC(16),
  MC(32),
  MC(48),
  MC(64),
  MC(80),

  MCS(96),
  MC(112),
  MC(128),
  MC(144),
  MC(160),
  MC(176),

  MCS(192),
  MC(208),
  MC(224),
  MC(240),
  MC(255),

  MS(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),

}

Legend text giving the colours to look for on the minimap (in case of AllowMoreHeightlevels()).

Definition at line 141 of file smallmap_gui.cpp.

Initial value:
 {
  
  MC(1),
  MC(5),
  MC(9),
  MC(13),
  MC(15),

  MS(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),

}

Legend text giving the colours to look for on the minimap (original).

Definition at line 124 of file smallmap_gui.cpp.

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 211 of file smallmap_gui.cpp.

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 182 of file smallmap_gui.cpp.

const LegendAndColour* const _legend_table_extended[] [static]
Initial value:
 {
  _legend_land_contours_extended,
  _legend_vehicles,
  _legend_from_industries,
  _legend_linkstats,
  _legend_routes,
  _legend_vegetation,
  _legend_land_owners,
}

Definition at line 347 of file smallmap_gui.cpp.

const LegendAndColour* const _legend_table_old[] [static]
Initial value:
 {
  _legend_land_contours_old,
  _legend_vehicles,
  _legend_from_industries,
  _legend_linkstats,
  _legend_routes,
  _legend_vegetation,
  _legend_land_owners,
}

Definition at line 337 of file smallmap_gui.cpp.

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_FIELDS,          STR_SMALLMAP_LEGENDA_FIELDS),
  MK(PC_TREES,           STR_SMALLMAP_LEGENDA_TREES),
  MK(PC_GREEN,           STR_SMALLMAP_LEGENDA_FOREST),

  MS(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 195 of file smallmap_gui.cpp.

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 171 of file smallmap_gui.cpp.

Widget parts of the smallmap legend bar + image buttons.

Definition at line 3850 of file smallmap_gui.cpp.

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

Widget parts of the smallmap display.

Definition at line 3843 of file smallmap_gui.cpp.

const NWidgetPart _nested_smallmap_widgets[] [static]
Initial value:
 {
  NWidget(NWID_HORIZONTAL),
    NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
    NWidget(WWT_CAPTION, COLOUR_BROWN, SM_WIDGET_CAPTION), SetDataTip(STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
    NWidget(WWT_SHADEBOX, COLOUR_BROWN),
    NWidget(WWT_STICKYBOX, COLOUR_BROWN),
  EndContainer(),
  NWidgetFunction(SmallMapDisplay), 
  
  NWidget(NWID_HORIZONTAL),
    NWidget(WWT_PANEL, COLOUR_BROWN),
      NWidget(NWID_HORIZONTAL),
        NWidget(NWID_SELECTION, INVALID_COLOUR, SM_WIDGET_SELECT_BUTTONS),
          NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
            NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, SM_WIDGET_ENABLE_ALL), SetDataTip(STR_SMALLMAP_ENABLE_ALL, STR_NULL),
            NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, SM_WIDGET_DISABLE_ALL), SetDataTip(STR_SMALLMAP_DISABLE_ALL, STR_NULL),
            NWidget(WWT_TEXTBTN, COLOUR_BROWN, SM_WIDGET_SHOW_HEIGHT), SetDataTip(STR_SMALLMAP_SHOW_HEIGHT, STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT),
          EndContainer(),
          NWidget(NWID_SPACER), SetFill(1, 1),
        EndContainer(),
        NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
      EndContainer(),
    EndContainer(),
    NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
  EndContainer(),
}

Definition at line 3901 of file smallmap_gui.cpp.

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 1408 of file smallmap_gui.cpp.

bool _smallmap_show_heightmap = false [static]

Show heightmap in industry and owner mode of smallmap window.

Definition at line 236 of file smallmap_gui.cpp.

Referenced by GetSmallMapIndustriesPixels(), GetSmallMapLinkStatsPixels(), GetSmallMapOwnerPixels(), and SmallMapWindow::OnClick().

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 1424 of file smallmap_gui.cpp.

const uint32 _stuck_counter_colours[] [static]
Initial value:
 {
  MKCOLOUR(0xD0D0D0D0),
  MKCOLOUR(0xCECECECE),
  MKCOLOUR(0xBFBFBFBF),
  MKCOLOUR(0xBDBDBDBD),
  MKCOLOUR(0xBABABABA),
  MKCOLOUR(0xB8B8B8B8),
  MKCOLOUR(0xB6B6B6B6),
  MKCOLOUR(0xB4B4B4B4),
}

Colour Coding for Stuck Counter.

Definition at line 1319 of file smallmap_gui.cpp.

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 1440 of file smallmap_gui.cpp.

const uint32 _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 1698 of file smallmap_gui.cpp.

const byte _vehicle_type_colours[6] [static]
Initial value:

Vehicle colours in SMT_VEHICLES mode.

Indexed by VehicleTypeByte.

Definition at line 1794 of file smallmap_gui.cpp.

const uint32 _violet_map_heights_extended[] [static]

Height map colours for the violet colour scheme, ordered by height.

Used when AllowMoreHeightlevels() is true. For the moment the aray is extended to 256 levels.

Definition at line 1021 of file smallmap_gui.cpp.

const uint32 _violet_map_heights_old[] [static]
Initial value:
 {
  MKCOLOUR(0x04dcdcdc), 
  MKCOLOUR_XXXX(0x80),
  MKCOLOUR_XYXY(0x80, 0x81),
  MKCOLOUR_XXXX(0x81),
  MKCOLOUR_XYXY(0x81, 0x82),
  MKCOLOUR_XXXX(0x82),
  MKCOLOUR_XYXY(0x82, 0x83),
  MKCOLOUR_XXXX(0x83),
  MKCOLOUR_XYXY(0x83, 0x84),
  MKCOLOUR_XXXX(0x84),
  MKCOLOUR_XYXY(0x84, 0x85),
  MKCOLOUR_XXXX(0x85),
  MKCOLOUR_XYXY(0x85, 0x86),
  MKCOLOUR_XXXX(0x86),
  MKCOLOUR_XYXY(0x86, 0x87),
  MKCOLOUR_XXXX(0x87),
  MKCOLOUR_XXXX(0x87),
}

Height map colours for the violet colour scheme, ordered by height.

This is the original array for use when AllowMoreHeightlevels() is false.

Definition at line 995 of file smallmap_gui.cpp.