tile.h
changeset 3794 f72053a38797
parent 3773 0019b5f70ea9
child 3900 2c84ed52709d
equal deleted inserted replaced
3793:7fe24e10ea63 3794:f72053a38797
    29 
    29 
    30 Slope GetTileh(uint n, uint w, uint e, uint s, uint *h);
    30 Slope GetTileh(uint n, uint w, uint e, uint s, uint *h);
    31 Slope GetTileSlope(TileIndex tile, uint *h);
    31 Slope GetTileSlope(TileIndex tile, uint *h);
    32 uint GetTileZ(TileIndex tile);
    32 uint GetTileZ(TileIndex tile);
    33 uint GetTileMaxZ(TileIndex tile);
    33 uint GetTileMaxZ(TileIndex tile);
    34 
       
    35 static inline bool CorrectZ(Slope tileh)
       
    36 {
       
    37 	/* tile height must be corrected if the north corner is not raised, but
       
    38 	 * any other corner is. These are the cases 1 till 7 */
       
    39 	return IS_INT_INSIDE(tileh, 1, 8);
       
    40 }
       
    41 
    34 
    42 static inline uint TileHeight(TileIndex tile)
    35 static inline uint TileHeight(TileIndex tile)
    43 {
    36 {
    44 	assert(tile < MapSize());
    37 	assert(tile < MapSize());
    45 	return GB(_m[tile].type_height, 0, 4);
    38 	return GB(_m[tile].type_height, 0, 4);