summaryrefslogtreecommitdiff
path: root/water_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-07 17:02:43 +0000
committertron <tron@openttd.org>2005-01-07 17:02:43 +0000
commit7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4 (patch)
treee4137b60a824b45ce09f668d58520e36dba10256 /water_cmd.c
parentf5c33e50733c46cee14e84ade6da0c171d96064b (diff)
downloadopenttd-7ca6b2b8b0d6f66966fa2ff01e3e9961314dfcc4.tar.xz
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
Diffstat (limited to 'water_cmd.c')
-rw-r--r--water_cmd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/water_cmd.c b/water_cmd.c
index 16d3e09d3..f29a06391 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -197,7 +197,7 @@ int32 CmdBuildCanal(int x, int y, uint32 flags, uint32 p1, uint32 p2)
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
// move in which direction?
- delta = (GET_TILE_X(tile) == GET_TILE_X(endtile)) ? TILE_XY(0,1) : TILE_XY(1,0);
+ delta = (TileX(tile) == TileX(endtile)) ? TILE_XY(0,1) : TILE_XY(1,0);
if (endtile < tile) delta = -delta;
cost = 0;
@@ -267,8 +267,8 @@ static int32 ClearTile_Water(uint tile, byte flags) {
return CMD_ERROR;
// Make sure it's not an edge tile.
- if (!(IS_INT_INSIDE(GET_TILE_X(tile), 1, MapMaxX() - 1) &&
- IS_INT_INSIDE(GET_TILE_Y(tile), 1, MapMaxY() - 1)))
+ if (!(IS_INT_INSIDE(TileX(tile), 1, MapMaxX() - 1) &&
+ IS_INT_INSIDE(TileY(tile), 1, MapMaxY() - 1)))
return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
if (m5 == 0) {
@@ -582,8 +582,8 @@ void TileLoop_Water(uint tile)
{{ 0, -1}, {0, 0}, {1, 0}, { 0, -1}, { 1, -1}}
};
- if (IS_INT_INSIDE(GET_TILE_X(tile), 1, MapSizeX() - 3 + 1) &&
- IS_INT_INSIDE(GET_TILE_Y(tile), 1, MapSizeY() - 3 + 1)) {
+ if (IS_INT_INSIDE(TileX(tile), 1, MapSizeX() - 3 + 1) &&
+ IS_INT_INSIDE(TileY(tile), 1, MapSizeY() - 3 + 1)) {
for(i=0; i!=4; i++)
TileLoopWaterHelper(tile, _tile_loop_offs_array[i]);
}
@@ -592,16 +592,16 @@ void TileLoop_Water(uint tile)
_current_player = OWNER_NONE;
// edges
- if (GET_TILE_X(tile) == 0 && IS_INT_INSIDE(GET_TILE_Y(tile), 1, MapSizeY() - 3 + 1)) //NE
+ if (TileX(tile) == 0 && IS_INT_INSIDE(TileY(tile), 1, MapSizeY() - 3 + 1)) //NE
TileLoopWaterHelper(tile, _tile_loop_offs_array[2]);
- if (GET_TILE_X(tile) == (MapSizeX() - 2) && IS_INT_INSIDE(GET_TILE_Y(tile), 1, MapSizeY() - 3 + 1)) //SW
+ if (TileX(tile) == (MapSizeX() - 2) && IS_INT_INSIDE(TileY(tile), 1, MapSizeY() - 3 + 1)) //SW
TileLoopWaterHelper(tile, _tile_loop_offs_array[0]);
- if (GET_TILE_Y(tile) == 0 && IS_INT_INSIDE(GET_TILE_X(tile), 1, MapSizeX() - 3 + 1)) //NW
+ if (TileY(tile) == 0 && IS_INT_INSIDE(TileX(tile), 1, MapSizeX() - 3 + 1)) //NW
TileLoopWaterHelper(tile, _tile_loop_offs_array[1]);
- if (GET_TILE_Y(tile) == (MapSizeY() - 2) && IS_INT_INSIDE(GET_TILE_X(tile), 1, MapSizeX() - 3 + 1)) //SE
+ if (TileY(tile) == (MapSizeY() - 2) && IS_INT_INSIDE(TileX(tile), 1, MapSizeX() - 3 + 1)) //SE
TileLoopWaterHelper(tile, _tile_loop_offs_array[3]);
}