OpenTTD Source  1.11.2
tile_type.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef TILE_TYPE_H
11 #define TILE_TYPE_H
12 
13 static const uint TILE_SIZE = 16;
14 static const uint TILE_UNIT_MASK = TILE_SIZE - 1;
15 static const uint TILE_PIXELS = 32;
16 static const uint TILE_HEIGHT = 8;
17 
18 static const uint MAX_BUILDING_PIXELS = 200;
19 static const int MAX_VEHICLE_PIXEL_X = 192;
20 static const int MAX_VEHICLE_PIXEL_Y = 96;
21 
22 static const uint MAX_TILE_HEIGHT = 255;
23 
24 static const uint MIN_HEIGHTMAP_HEIGHT = 1;
25 static const uint MIN_CUSTOM_TERRAIN_TYPE = 1;
26 
27 static const uint MIN_MAP_HEIGHT_LIMIT = 15;
29 
30 static const uint MIN_SNOWLINE_HEIGHT = 2;
31 static const uint DEF_SNOWLINE_HEIGHT = 10;
32 static const uint MAX_SNOWLINE_HEIGHT = (MAX_TILE_HEIGHT - 2);
33 
34 static const uint DEF_SNOW_COVERAGE = 40;
35 static const uint DEF_DESERT_COVERAGE = 50;
36 
37 
45 enum TileType {
57 };
58 
74 enum TropicZone {
78 };
79 
83 typedef uint32 TileIndex;
84 
88 static const TileIndex INVALID_TILE = (TileIndex)-1;
89 
90 #endif /* TILE_TYPE_H */
MP_CLEAR
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
Definition: tile_type.h:46
MP_HOUSE
@ MP_HOUSE
A house by a town.
Definition: tile_type.h:49
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:83
TROPICZONE_DESERT
@ TROPICZONE_DESERT
Tile is desert.
Definition: tile_type.h:76
MIN_SNOWLINE_HEIGHT
static const uint MIN_SNOWLINE_HEIGHT
Minimum snowline height.
Definition: tile_type.h:30
MAX_VEHICLE_PIXEL_Y
static const int MAX_VEHICLE_PIXEL_Y
Maximum height of a vehicle in pixels in #ZOOM_LVL_BASE.
Definition: tile_type.h:20
TROPICZONE_RAINFOREST
@ TROPICZONE_RAINFOREST
Rainforest tile.
Definition: tile_type.h:77
MP_RAILWAY
@ MP_RAILWAY
A railway.
Definition: tile_type.h:47
TILE_SIZE
static const uint TILE_SIZE
Tile size in world coordinates.
Definition: tile_type.h:13
MIN_CUSTOM_TERRAIN_TYPE
static const uint MIN_CUSTOM_TERRAIN_TYPE
Lowest possible peak value for world generation.
Definition: tile_type.h:25
MP_INDUSTRY
@ MP_INDUSTRY
Part of an industry.
Definition: tile_type.h:54
DEF_SNOWLINE_HEIGHT
static const uint DEF_SNOWLINE_HEIGHT
Default snowline height.
Definition: tile_type.h:31
MAX_TILE_HEIGHT
static const uint MAX_TILE_HEIGHT
Maximum allowed tile height.
Definition: tile_type.h:22
MAX_VEHICLE_PIXEL_X
static const int MAX_VEHICLE_PIXEL_X
Maximum width of a vehicle in pixels in #ZOOM_LVL_BASE.
Definition: tile_type.h:19
MP_ROAD
@ MP_ROAD
A tile with road (or tram tracks)
Definition: tile_type.h:48
TILE_UNIT_MASK
static const uint TILE_UNIT_MASK
For masking in/out the inner-tile world coordinate units.
Definition: tile_type.h:14
MAX_MAP_HEIGHT_LIMIT
static const uint MAX_MAP_HEIGHT_LIMIT
Upper bound of maximum allowed heightlevel (in the construction settings)
Definition: tile_type.h:28
MP_OBJECT
@ MP_OBJECT
Contains objects such as transmitters and owned land.
Definition: tile_type.h:56
MP_WATER
@ MP_WATER
Water tile.
Definition: tile_type.h:52
DEF_DESERT_COVERAGE
static const uint DEF_DESERT_COVERAGE
Default desert coverage.
Definition: tile_type.h:35
MAX_BUILDING_PIXELS
static const uint MAX_BUILDING_PIXELS
Maximum height of a building in pixels in #ZOOM_LVL_BASE. (Also applies to "bridge buildings" on the ...
Definition: tile_type.h:18
MP_TUNNELBRIDGE
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
Definition: tile_type.h:55
MP_TREES
@ MP_TREES
Tile got trees.
Definition: tile_type.h:50
MIN_HEIGHTMAP_HEIGHT
static const uint MIN_HEIGHTMAP_HEIGHT
Lowest possible peak value for heightmap creation.
Definition: tile_type.h:24
TropicZone
TropicZone
Additional infos of a tile on a tropic game.
Definition: tile_type.h:74
MIN_MAP_HEIGHT_LIMIT
static const uint MIN_MAP_HEIGHT_LIMIT
Lower bound of maximum allowed heightlevel (in the construction settings)
Definition: tile_type.h:27
MP_VOID
@ MP_VOID
Invisible tiles at the SW and SE border.
Definition: tile_type.h:53
TileType
TileType
The different types of tiles.
Definition: tile_type.h:45
MAX_SNOWLINE_HEIGHT
static const uint MAX_SNOWLINE_HEIGHT
Maximum allowed snowline height.
Definition: tile_type.h:32
MP_STATION
@ MP_STATION
A tile of a station.
Definition: tile_type.h:51
TILE_HEIGHT
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
Definition: tile_type.h:16
INVALID_TILE
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Definition: tile_type.h:88
TILE_PIXELS
static const uint TILE_PIXELS
Pixel distance between tile columns/rows in #ZOOM_LVL_BASE.
Definition: tile_type.h:15
TROPICZONE_NORMAL
@ TROPICZONE_NORMAL
Normal tropiczone.
Definition: tile_type.h:75
DEF_SNOW_COVERAGE
static const uint DEF_SNOW_COVERAGE
Default snow coverage.
Definition: tile_type.h:34