OpenTTD
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
map_type.h File Reference

Types related to maps. More...

Go to the source code of this file.

Data Structures

struct  Tile
 Data that is stored per tile. More...
struct  TileExtended
 Data that is stored per tile. More...
struct  TileIndexDiffC
 A pair-construct of a TileIndexDiff. More...

Macros

#define STRAIGHT_TRACK_LENGTH   7071/10000
 Approximation of the length of a straight track, relative to a diagonal track (ie the size of a tile side).

Typedefs

typedef int32 TileIndexDiff
 An offset value between to tiles.

Enumerations

enum  LevelMode { LM_LEVEL, LM_LOWER, LM_RAISE }
 Argument for CmdLevelLand describing what to do. More...

Functions

 assert_compile (sizeof(Tile)==8)

Variables

static const uint MIN_MAP_SIZE_BITS = 6
 Minimal and maximal map width and height.
static const uint MAX_MAP_SIZE_BITS = 12
 Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS.
static const uint MIN_MAP_SIZE = 1 << MIN_MAP_SIZE_BITS
 Minimal map size = 64.
static const uint MAX_MAP_SIZE = 1 << MAX_MAP_SIZE_BITS
 Maximal map size = 4096.

Detailed Description

Types related to maps.

Definition in file map_type.h.

Macro Definition Documentation

#define STRAIGHT_TRACK_LENGTH   7071/10000

Approximation of the length of a straight track, relative to a diagonal track (ie the size of a tile side).

#defined instead of const so it can stay integer. (no runtime float operations) Is this needed? Watch out! There are no brackets around here, to prevent intermediate rounding! Be careful when using this! This value should be sqrt(2)/2 ~ 0.7071

Definition at line 79 of file map_type.h.

Referenced by NPFDistanceTrack().

Typedef Documentation

typedef int32 TileIndexDiff

An offset value between to tiles.

This value is used for the difference between to tiles. It can be added to a tileindex to get the resulting tileindex of the start tile applied with this saved difference.

See Also
TileDiffXY(int, int)

Definition at line 50 of file map_type.h.

Enumeration Type Documentation

enum LevelMode

Argument for CmdLevelLand describing what to do.

Enumerator:
LM_LEVEL 

Level the land.

LM_LOWER 

Lower the land.

LM_RAISE 

Raise the land.

Definition at line 82 of file map_type.h.

Variable Documentation

const uint MIN_MAP_SIZE_BITS = 6
static

Minimal and maximal map width and height.

Minimal size of map is equal to 2 ^ MIN_MAP_SIZE_BITS

Definition at line 64 of file map_type.h.

Referenced by RunTileLoop(), and TGPGetMaxHeight().