OpenTTD Source  20241108-master-g80f628063a
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 
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 
43 enum LevelMode : uint8_t {
47 };
48 
49 #endif /* MAP_TYPE_H */
static const uint MIN_MAP_SIZE_BITS
Minimal and maximal map width and height.
Definition: map_type.h:37
static const uint MAX_MAP_SIZE
Maximal map size = 4096.
Definition: map_type.h:40
static const uint MIN_MAP_SIZE
Minimal map size = 64.
Definition: map_type.h:39
int32_t TileIndexDiff
An offset value between two tiles.
Definition: map_type.h:23
static const uint MAX_MAP_SIZE_BITS
Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS.
Definition: map_type.h:38
LevelMode
Argument for CmdLevelLand describing what to do.
Definition: map_type.h:43
@ LM_LEVEL
Level the land.
Definition: map_type.h:44
@ LM_LOWER
Lower the land.
Definition: map_type.h:45
@ LM_RAISE
Raise the land.
Definition: map_type.h:46
A pair-construct of a TileIndexDiff.
Definition: map_type.h:31
int16_t x
The x value of the coordinate.
Definition: map_type.h:32
int16_t y
The y value of the coordinate.
Definition: map_type.h:33