summaryrefslogtreecommitdiff
path: root/train_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 /train_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 'train_cmd.c')
-rw-r--r--train_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 44813fdef..a1ff5150c 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -266,8 +266,8 @@ static int32 CmdBuildRailWagon(uint engine, uint tile, uint32 flags)
v->direction = (byte)(dir*2+1);
v->tile = (TileIndex)tile;
- x = GET_TILE_X(tile)*16 | _vehicle_initial_x_fract[dir];
- y = GET_TILE_Y(tile)*16 | _vehicle_initial_y_fract[dir];
+ x = TileX(tile) * 16 | _vehicle_initial_x_fract[dir];
+ y = TileY(tile) * 16 | _vehicle_initial_y_fract[dir];
v->x_pos = x;
v->y_pos = y;
@@ -1846,8 +1846,8 @@ static const byte _new_vehicle_direction_table[11] = {
static int GetNewVehicleDirectionByTile(uint new_tile, uint old_tile)
{
- uint offs = (GET_TILE_Y(new_tile) - GET_TILE_Y(old_tile) + 1) * 4 +
- GET_TILE_X(new_tile) - GET_TILE_X(old_tile) + 1;
+ uint offs = (TileY(new_tile) - TileY(old_tile) + 1) * 4 +
+ TileX(new_tile) - TileX(old_tile) + 1;
assert(offs < 11);
return _new_vehicle_direction_table[offs];
}