tron@2186: /* $Id$ */ tron@2186: rubidium@8635: /** @file map_type.h Types related to maps. */ rubidium@7036: rubidium@8635: #ifndef MAP_TYPE_H rubidium@8635: #define MAP_TYPE_H tron@926: rubidium@7036: /** rubidium@7036: * Data that is stored per tile. Also used TileExtended for this. rubidium@7036: * Look at docs/landscape.html for the exact meaning of the members. rubidium@7036: */ rubidium@6574: struct Tile { rubidium@8635: byte type_height; ///< The type (bits 4..7) and height of the northern corner rubidium@8635: byte m1; ///< Primarily used for ownership information rubidium@8635: uint16 m2; ///< Primarily used for indices to towns, industries and stations rubidium@8635: byte m3; ///< General purpose rubidium@8635: byte m4; ///< General purpose rubidium@8635: byte m5; ///< General purpose rubidium@8635: byte m6; ///< Primarily used for bridges and rainforest/desert rubidium@6574: }; tron@2049: rubidium@7036: /** rubidium@7036: * Data that is stored per tile. Also used Tile for this. rubidium@7036: * Look at docs/landscape.html for the exact meaning of the members. rubidium@7036: */ maedhros@6658: struct TileExtended { rubidium@7036: byte m7; ///< Primarily used for newgrf support maedhros@6658: }; maedhros@6658: rubidium@8042: /** rubidium@8042: * An offset value between to tiles. rubidium@8042: * rubidium@8042: * This value is used fro the difference between rubidium@8042: * to tiles. It can be added to a tileindex to get rubidium@8042: * the resulting tileindex of the start tile applied rubidium@8042: * with this saved difference. rubidium@8042: * rubidium@8042: * @see TileDiffXY(int, int) rubidium@8042: */ tron@1981: typedef int32 TileIndexDiff; tron@1981: rubidium@8042: /** rubidium@8042: * A pair-construct of a TileIndexDiff. rubidium@8042: * rubidium@8042: * This can be used to save the difference between to rubidium@8042: * tiles as a pair of x and y value. rubidium@8042: */ rubidium@6574: struct TileIndexDiffC { rubidium@8042: int16 x; ///< The x value of the coordinate rubidium@8042: int16 y; ///< The y value of the coordinate rubidium@6574: }; tron@909: rubidium@8042: /** rubidium@8635: * Approximation of the length of a straight track, relative to a diagonal rubidium@8042: * track (ie the size of a tile side). rubidium@8042: * rubidium@8042: * #defined instead of const so it can matthijs@1677: * stay integer. (no runtime float operations) Is this needed? matthijs@1679: * Watch out! There are _no_ brackets around here, to prevent intermediate matthijs@1679: * rounding! Be careful when using this! rubidium@8635: * This value should be sqrt(2)/2 ~ 0.7071 rubidium@8635: */ matthijs@1679: #define STRAIGHT_TRACK_LENGTH 7071/10000 matthijs@1677: rubidium@8635: #endif /* MAP_TYPE_H */