equal
deleted
inserted
replaced
14 |
14 |
15 assert(tile < MapSize()); |
15 assert(tile < MapSize()); |
16 |
16 |
17 if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) { |
17 if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) { |
18 if (h != NULL) *h = 0; |
18 if (h != NULL) *h = 0; |
19 return 0; |
19 return SLOPE_FLAT; |
20 } |
20 } |
21 |
21 |
22 min = a = TileHeight(tile); |
22 min = a = TileHeight(tile); |
23 b = TileHeight(tile + TileDiffXY(1, 0)); |
23 b = TileHeight(tile + TileDiffXY(1, 0)); |
24 if (min >= b) min = b; |
24 if (min >= b) min = b; |
33 if ((d -= min) != 0) r += (--d << 4) + SLOPE_S; |
33 if ((d -= min) != 0) r += (--d << 4) + SLOPE_S; |
34 if ((b -= min) != 0) r += (--b << 4) + SLOPE_W; |
34 if ((b -= min) != 0) r += (--b << 4) + SLOPE_W; |
35 |
35 |
36 if (h != NULL) *h = min * TILE_HEIGHT; |
36 if (h != NULL) *h = min * TILE_HEIGHT; |
37 |
37 |
38 return r; |
38 return (Slope)r; |
39 } |
39 } |
40 |
40 |
41 uint GetTileZ(TileIndex tile) |
41 uint GetTileZ(TileIndex tile) |
42 { |
42 { |
43 uint h; |
43 uint h; |