OpenTTD Source: src/map_type.h Source File

OpenTTD Source 14.1

map_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 MAP_TYPE_H
11 #define MAP_TYPE_H
12
23 typedef int32_t TileIndexDiff;
24
31 struct TileIndexDiffC {
32 int16_t x;
33 int16_t y;
34 };
35
37 static const uint MIN_MAP_SIZE_BITS = 6;
38 static const uint MAX_MAP_SIZE_BITS = 12;
39 static const uint MIN_MAP_SIZE = 1U << MIN_MAP_SIZE_BITS;
40 static const uint MAX_MAP_SIZE = 1U << MAX_MAP_SIZE_BITS;
41
52 #define STRAIGHT_TRACK_LENGTH 7071/10000
53
55 enum LevelMode : byte {
56 LM_LEVEL,
57 LM_LOWER,
58 LM_RAISE,
59 };
60
61 #endif /* MAP_TYPE_H */
MIN_MAP_SIZE
static const uint MIN_MAP_SIZE
Minimal map size = 64.
Definition: map_type.h:39
LM_LOWER
@ LM_LOWER
Lower the land.
Definition: map_type.h:57
MIN_MAP_SIZE_BITS
static const uint MIN_MAP_SIZE_BITS
Minimal and maximal map width and height.
Definition: map_type.h:37
LM_LEVEL
@ LM_LEVEL
Level the land.
Definition: map_type.h:56
TileIndexDiffC
A pair-construct of a TileIndexDiff.
Definition: map_type.h:31
MAX_MAP_SIZE_BITS
static const uint MAX_MAP_SIZE_BITS
Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS.
Definition: map_type.h:38
TileIndexDiff
int32_t TileIndexDiff
An offset value between two tiles.
Definition: map_type.h:23
TileIndexDiffC::y
int16_t y
The y value of the coordinate.
Definition: map_type.h:33
LevelMode
LevelMode
Argument for CmdLevelLand describing what to do.
Definition: map_type.h:55
MAX_MAP_SIZE
static const uint MAX_MAP_SIZE
Maximal map size = 4096.
Definition: map_type.h:40
LM_RAISE
@ LM_RAISE
Raise the land.
Definition: map_type.h:58
TileIndexDiffC::x
int16_t x
The x value of the coordinate.
Definition: map_type.h:32