summaryrefslogtreecommitdiff
path: root/src/map_func.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-01-22 17:48:08 +0000
committerfrosch <frosch@openttd.org>2008-01-22 17:48:08 +0000
commit49d2087d7f15acd791c17b96dcbdb639ed7d8ae2 (patch)
tree810014ffd4cea94ba5f29e43a23535441ee0156a /src/map_func.h
parentb99c83246b4029f91579712ae9044fa9e1f6b2c9 (diff)
downloadopenttd-49d2087d7f15acd791c17b96dcbdb639ed7d8ae2.tar.xz
(svn r11947) -Feature: Make use of new sprites added by Action5 type 0D.
Tiles which only consist of shore do not flood anymore, instead they get removed if they are no longer connected to flooding water.
Diffstat (limited to 'src/map_func.h')
-rw-r--r--src/map_func.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map_func.h b/src/map_func.h
index 4687668a2..dc40b1011 100644
--- a/src/map_func.h
+++ b/src/map_func.h
@@ -244,6 +244,20 @@ static inline TileIndexDiffC TileIndexDiffCByDiagDir(DiagDirection dir)
}
/**
+ * Returns the TileIndexDiffC offset from a Direction.
+ *
+ * @param dir The given direction
+ * @return The offset as TileIndexDiffC value
+ */
+static inline TileIndexDiffC TileIndexDiffCByDir(Direction dir)
+{
+ extern const TileIndexDiffC _tileoffs_by_dir[DIR_END];
+
+ assert(IsValidDirection(dir));
+ return _tileoffs_by_dir[dir];
+}
+
+/**
* Add a TileIndexDiffC to a TileIndex and returns the new one.
*
* Returns tile + the diff given in diff. If the result tile would end up