summaryrefslogtreecommitdiff
path: root/vehicle.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 /vehicle.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 'vehicle.c')
-rw-r--r--vehicle.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/vehicle.c b/vehicle.c
index f58d05cfa..f6bb1d39e 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -105,10 +105,10 @@ bool EnsureNoVehicleZ(TileIndex tile, byte z)
Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z)
{
- int x1 = GET_TILE_X(from);
- int y1 = GET_TILE_Y(from);
- int x2 = GET_TILE_X(to);
- int y2 = GET_TILE_Y(to);
+ int x1 = TileX(from);
+ int y1 = TileY(from);
+ int x2 = TileX(to);
+ int y2 = TileY(to);
Vehicle *veh;
/* Make sure x1 < x2 or y1 < y2 */
@@ -148,7 +148,7 @@ void VehiclePositionChanged(Vehicle *v)
void UpdateWaypointSign(Waypoint *cp)
{
- Point pt = RemapCoords2(GET_TILE_X(cp->xy)*16, GET_TILE_Y(cp->xy)*16);
+ Point pt = RemapCoords2(TileX(cp->xy) * 16, TileY(cp->xy) * 16);
SetDParam(0, cp - _waypoints);
UpdateViewportSignPos(&cp->sign, pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT);
}
@@ -263,7 +263,7 @@ void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc)
{
int x,y,x2,y2;
VehicleID veh;
- Point pt = RemapCoords(GET_TILE_X(tile) * 16, GET_TILE_Y(tile) * 16, 0);
+ Point pt = RemapCoords(TileX(tile) * 16, TileY(tile) * 16, 0);
x2 = ((pt.x + 104) & 0x1F80) >> 7;
x = ((pt.x - 174) & 0x1F80) >> 7;