From 49d2087d7f15acd791c17b96dcbdb639ed7d8ae2 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 22 Jan 2008 17:48:08 +0000 Subject: (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. --- src/map_func.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/map_func.h') 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 @@ -243,6 +243,20 @@ static inline TileIndexDiffC TileIndexDiffCByDiagDir(DiagDirection dir) return _tileoffs_by_diagdir[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. * -- cgit v1.2.3-54-g00ecf