map_type.h

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef MAP_TYPE_H
00013 #define MAP_TYPE_H
00014 
00019 struct Tile {
00020   byte   type_height; 
00021   byte   m1;          
00022   uint16 m2;          
00023   byte   m3;          
00024   byte   m4;          
00025   byte   m5;          
00026   byte   m6;          
00027 };
00028 
00033 struct TileExtended {
00034   byte m7; 
00035 };
00036 
00044 struct TileHeightData {
00045   byte heightlevel;
00046 };
00047 
00058 typedef int32 TileIndexDiff;
00059 
00066 struct TileIndexDiffC {
00067   int16 x;        
00068   int16 y;        
00069 };
00070 
00072 static const uint MIN_MAP_SIZE_BITS  = 6;                       
00073 static const uint MAX_MAP_SIZE_BITS  = 15;                      
00074 static const uint MAX_MAP_TILES_BITS = 26;                      
00075 static const uint MIN_MAP_SIZE       = 1 << MIN_MAP_SIZE_BITS;  
00076 static const uint MAX_MAP_SIZE       = 1 << MAX_MAP_SIZE_BITS;  
00077 static const uint MAX_MAP_TILES      = 1 << MAX_MAP_TILES_BITS; 
00078 
00089 #define STRAIGHT_TRACK_LENGTH 7071/10000
00090 
00092 enum LevelMode {
00093   LM_LEVEL, 
00094   LM_LOWER, 
00095   LM_RAISE, 
00096 };
00097 
00098 #endif /* MAP_TYPE_H */