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