diff options
author | tron <tron@openttd.org> | 2005-01-06 11:39:00 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-06 11:39:00 +0000 |
commit | f8c95a1dbeac23296cacc83ae25d2a8b352cd83d (patch) | |
tree | f875975dc056d7d3fea370018fa0bdf62837fd3e /rail_gui.c | |
parent | 790b03c7071388addd4cb064e473e96f8e1f12e0 (diff) | |
download | openttd-f8c95a1dbeac23296cacc83ae25d2a8b352cd83d.tar.xz |
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
Diffstat (limited to 'rail_gui.c')
-rw-r--r-- | rail_gui.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rail_gui.c b/rail_gui.c index f80590e68..5e0ea7a33 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -385,14 +385,14 @@ static int GetBestFit1x1(int x, int y) // get the rail in each direction tile = TILE_FROM_XY(x,y); for(i=0; i!=5; i++) { - static TileIndexDiff _tile_inc[5] = { - TILE_XY(-1, 0), - TILE_XY(0, 1) - TILE_XY(-1, 0), - TILE_XY(1, 0) - TILE_XY(0, 1), - TILE_XY(0, -1) - TILE_XY(1, 0), - TILE_XY(0, 0) - TILE_XY(0, -1), + static const TileIndexDiffC _tile_inc[] = { + {-1 , 0 }, + { 0 - -1, 1 - 0}, + { 1 - 0, 0 - 1}, + { 0 - 1, -1 - 0}, + { 0 - 0, 0 - -1} }; - tile += _tile_inc[i]; + tile += ToTileIndexDiff(_tile_inc[i]); m[i] = 0; if (IS_TILETYPE(tile, MP_RAILWAY) && _map5[tile] < 0x80) m[i] = _map5[tile]&0x3F; |