Mercurial > hg > openttd
view bridge_map.c @ 3495:2ed3703642c2 draft
(svn r4346) CodeChange : Add and Use Accessors to Industry's Stage and Counter construction. Removed last direct map access from Disaster_cmd.c as well. Based on work from Rubidium in tfc_newmap
author | belugas <belugas@openttd.org> |
---|---|
date | Mon, 10 Apr 2006 15:09:56 +0000 |
parents | a636aecc412f |
children | 663c182ffca8 |
line wrap: on
line source
/* $Id$ */ #include "stdafx.h" #include "openttd.h" #include "bridge_map.h" TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir) { TileIndexDiff delta = TileOffsByDir(dir); assert(DiagDirToAxis(dir) == GetBridgeAxis(tile)); do { tile += delta; } while (!IsBridgeRamp(tile)); return tile; } TileIndex GetSouthernBridgeEnd(TileIndex t) { return GetBridgeEnd(t, AxisToDiagDir(GetBridgeAxis(t))); } TileIndex GetOtherBridgeEnd(TileIndex tile) { TileIndexDiff delta = TileOffsByDir(GetBridgeRampDirection(tile)); do { tile += delta; } while (!IsBridgeRamp(tile)); return tile; }