summaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-05 13:32:03 +0000
committertron <tron@openttd.org>2005-01-05 13:32:03 +0000
commit67161506ad98a7636d3c9f141b5595481d079e93 (patch)
treeb9a5829b3d37c53a2de48d1ef28960f41804f4dc /map.h
parent2543158c8e0d105148bc38522fba43aa3428d76a (diff)
downloadopenttd-67161506ad98a7636d3c9f141b5595481d079e93.tar.xz
(svn r1386) Move TileIndexDiff to map.h
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
Diffstat (limited to 'map.h')
-rw-r--r--map.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/map.h b/map.h
index a62f65f34..7a5ed5ff4 100644
--- a/map.h
+++ b/map.h
@@ -24,4 +24,15 @@ static inline uint MapMaxY(void) { return MapSizeY() - 1; }
/* The number of tiles in the map */
static inline uint MapSize(void) { return MapSizeX() * MapSizeY(); }
+typedef int16 TileIndexDiff;
+
+
+static inline TileIndexDiff TileOffsByDir(uint dir)
+{
+ extern const TileIndexDiff _tileoffs_by_dir[4];
+
+ assert(dir < lengthof(_tileoffs_by_dir));
+ return _tileoffs_by_dir[dir];
+}
+
#endif