diff options
author | alberth <alberth@openttd.org> | 2010-10-23 20:34:12 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-10-23 20:34:12 +0000 |
commit | cccbc8f418b578d4ad378e5c0570b7f473391ce8 (patch) | |
tree | 1d22e22d2d8c5fd3cae84e99143f2f2239dc68ea /src/tilearea_type.h | |
parent | 8f24ec94717ec7de4d2483e3c8eb8f0f042f9b5c (diff) | |
download | openttd-cccbc8f418b578d4ad378e5c0570b7f473391ce8.tar.xz |
(svn r21019) -Add: Use center of industry to focus on in the industry gui.
Diffstat (limited to 'src/tilearea_type.h')
-rw-r--r-- | src/tilearea_type.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tilearea_type.h b/src/tilearea_type.h index 711ac986d..3207c9e3f 100644 --- a/src/tilearea_type.h +++ b/src/tilearea_type.h @@ -12,7 +12,7 @@ #ifndef TILEAREA_TYPE_H #define TILEAREA_TYPE_H -#include "tile_type.h" +#include "map_func.h" /** Represents the covered area of e.g. a rail station */ struct TileArea { @@ -49,6 +49,15 @@ struct TileArea { bool Intersects(const TileArea &ta) const; void ClampToMap(); + + /** + * Get the center tile. + * @return The tile at the center, or just north of it. + */ + TileIndex GetCenterTile() const + { + return TILE_ADDXY(this->tile, this->w / 2, this->h / 2); + } }; #endif /* TILEAREA_TYPE_H */ |