OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

map_type.h
Go to the documentation of this file.
1 /* $Id: map_type.h 27132 2015-02-01 12:25:51Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
12 #ifndef MAP_TYPE_H
13 #define MAP_TYPE_H
14
19 struct Tile {
20 byte type;
21 byte height;
22 uint16 m2;
23 byte m1;
24 byte m3;
25 byte m4;
26 byte m5;
27 };
28
29 assert_compile(sizeof(Tile) == 8);
30
35 struct TileExtended {
36 byte m6;
37 byte m7;
38 };
39
50 typedef int32 TileIndexDiff;
51
58 struct TileIndexDiffC {
59 int16 x;
60 int16 y;
61 };
62
64 static const uint MIN_MAP_SIZE_BITS = 6;
65 static const uint MAX_MAP_SIZE_BITS = 12;
66 static const uint MIN_MAP_SIZE = 1 << MIN_MAP_SIZE_BITS;
67 static const uint MAX_MAP_SIZE = 1 << MAX_MAP_SIZE_BITS;
68
79 #define STRAIGHT_TRACK_LENGTH 7071/10000
80
82 enum LevelMode {
83 LM_LEVEL,
84 LM_LOWER,
85 LM_RAISE,
86 };
87
88 #endif /* MAP_TYPE_H */