diff options
author | glx <glx@openttd.org> | 2006-09-06 01:56:01 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2006-09-06 01:56:01 +0000 |
commit | 7c6851b436003e3f4fe694b6bbf751f49d9d3e47 (patch) | |
tree | fc36ea231f8fae94996dd2d24463f6a7fbfa59ec /map.h | |
parent | 3fee2555433c62735640c7e99f8a777ba060e5e5 (diff) | |
download | openttd-7c6851b436003e3f4fe694b6bbf751f49d9d3e47.tar.xz |
(svn r6408) -Fix(r6406): compilation was broken
-Codechange: Rename TileIndexDiffCByDir to TileIndexDiffCByDiagDir because it accepts DiagDirections
Diffstat (limited to 'map.h')
-rw-r--r-- | map.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -119,9 +119,11 @@ static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc) uint TileAddWrap(TileIndex tile, int addx, int addy); -static inline TileIndexDiffC TileIndexDiffCByDir(uint dir) { - extern const TileIndexDiffC _tileoffs_by_dir[4]; - return _tileoffs_by_dir[dir]; +static inline TileIndexDiffC TileIndexDiffCByDiagDir(uint dir) { + extern const TileIndexDiffC _tileoffs_by_diagdir[4]; + + assert(dir < lengthof(_tileoffs_by_diagdir)); + return _tileoffs_by_diagdir[dir]; } /* Returns tile + the diff given in diff. If the result tile would end up @@ -157,8 +159,7 @@ uint DistanceFromEdge(TileIndex); // shortest distance from any edge of the map } while (var += TileDiffXY(0, 1) - (w), --h_cur != 0); \ } -typedef enum DiagDirection DiagDirection; -static inline TileIndexDiff TileOffsByDiagDir(DiagDirection dir) +static inline TileIndexDiff TileOffsByDiagDir(uint dir) { extern const TileIndexDiffC _tileoffs_by_diagdir[4]; @@ -166,8 +167,7 @@ static inline TileIndexDiff TileOffsByDiagDir(DiagDirection dir) return ToTileIndexDiff(_tileoffs_by_diagdir[dir]); } -typedef enum Direction Direction; -static inline TileIndexDiff TileOffsByDir(Direction dir) +static inline TileIndexDiff TileOffsByDir(uint dir) { extern const TileIndexDiffC _tileoffs_by_dir[8]; |