OpenTTD Source  13.2.1
smallmap_gui.h File Reference
#include "industry_type.h"
#include "company_base.h"
#include "window_gui.h"
#include "strings_func.h"
#include "blitter/factory.hpp"
#include "linkgraph/linkgraph_gui.h"
#include "widgets/smallmap_widget.h"
#include "guitimer_func.h"

Go to the source code of this file.

Data Structures

struct  LegendAndColour
 Structure for holding relevant data for legends in small map. More...
 
class  SmallMapWindow
 Class managing the smallmap window. More...
 

Enumerations

enum  IncludeHeightmap { IncludeHeightmap::Never, IncludeHeightmap::IfEnabled, IncludeHeightmap::Always }
 Enum for how to include the heightmap pixels/colours in small map related functions. More...
 

Functions

void BuildLinkStatsLegend ()
 Populate legend table for the link stat view.
 
void BuildIndustriesLegend ()
 Fills an array for the industries legends.
 
void ShowSmallMap ()
 Show the smallmap window.
 
void BuildLandLegend ()
 (Re)build the colour tables for the legends.
 
void BuildOwnerLegend ()
 Completes the array for the owned property legend.
 
uint32 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...
 

Detailed Description

Smallmap GUI functions.

Definition in file smallmap_gui.h.

Enumeration Type Documentation

◆ IncludeHeightmap

enum IncludeHeightmap
strong

Enum for how to include the heightmap pixels/colours in small map related functions.

Enumerator
Never 

Never include the heightmap.

IfEnabled 

Only include the heightmap if its enabled in the gui by the player.

Always 

Always include the heightmap.

Definition at line 31 of file smallmap_gui.h.

Function Documentation

◆ GetSmallMapOwnerPixels()

uint32 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)
Parameters
tileThe tile of which we would like to get the colour.
tEffective tile type of the tile (see SmallMapWindow::GetTileColours).
include_heightmapWhether 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 565 of file smallmap_gui.cpp.

References MP_VOID.