tron@2186: /* $Id$ */ tron@2186: rubidium@8139: /** @file map_type.h Types related to maps. */ rubidium@6540: rubidium@8139: #ifndef MAP_TYPE_H rubidium@8139: #define MAP_TYPE_H tron@926: rubidium@6540: /** rubidium@6540: * Data that is stored per tile. Also used TileExtended for this. rubidium@6540: * Look at docs/landscape.html for the exact meaning of the members. rubidium@6540: */ rubidium@6248: struct Tile { rubidium@8139: byte type_height; ///< The type (bits 4..7) and height of the northern corner rubidium@8139: byte m1; ///< Primarily used for ownership information rubidium@8139: uint16 m2; ///< Primarily used for indices to towns, industries and stations rubidium@8139: byte m3; ///< General purpose rubidium@8139: byte m4; ///< General purpose rubidium@8139: byte m5; ///< General purpose rubidium@8139: byte m6; ///< Primarily used for bridges and rainforest/desert rubidium@6248: }; tron@2049: rubidium@6540: /** rubidium@6540: * Data that is stored per tile. Also used Tile for this. rubidium@6540: * Look at docs/landscape.html for the exact meaning of the members. rubidium@6540: */ maedhros@6332: struct TileExtended { rubidium@6540: byte m7; ///< Primarily used for newgrf support maedhros@6332: }; maedhros@6332: rubidium@7546: /** rubidium@7546: * An offset value between to tiles. rubidium@7546: * rubidium@7546: * This value is used fro the difference between rubidium@7546: * to tiles. It can be added to a tileindex to get rubidium@7546: * the resulting tileindex of the start tile applied rubidium@7546: * with this saved difference. rubidium@7546: * rubidium@7546: * @see TileDiffXY(int, int) rubidium@7546: */ tron@1981: typedef int32 TileIndexDiff; tron@1981: rubidium@7546: /** rubidium@7546: * A pair-construct of a TileIndexDiff. rubidium@7546: * rubidium@7546: * This can be used to save the difference between to rubidium@7546: * tiles as a pair of x and y value. rubidium@7546: */ rubidium@6248: struct TileIndexDiffC { rubidium@7546: int16 x; ///< The x value of the coordinate rubidium@7546: int16 y; ///< The y value of the coordinate rubidium@6248: }; tron@909: rubidium@7546: /** rubidium@8139: * Approximation of the length of a straight track, relative to a diagonal rubidium@7546: * track (ie the size of a tile side). rubidium@7546: * rubidium@7546: * #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@8139: * This value should be sqrt(2)/2 ~ 0.7071 rubidium@8139: */ matthijs@1679: #define STRAIGHT_TRACK_LENGTH 7071/10000 matthijs@1677: rubidium@8139: #endif /* MAP_TYPE_H */