summaryrefslogtreecommitdiff
path: root/src/map_type.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-20 11:25:39 +0000
committersmatz <smatz@openttd.org>2009-06-20 11:25:39 +0000
commit4419366f94f75032b53362e2722b6476beb02866 (patch)
tree2d092dc3dc2fea7055ac87bc739b223a83efbeb5 /src/map_type.h
parent88ec646c1f843b95635510988c793e4e83cbc8cc (diff)
downloadopenttd-4419366f94f75032b53362e2722b6476beb02866.tar.xz
(svn r16603) -Codechange: enumify map size limits (based on a patch by Bilbo)
Diffstat (limited to 'src/map_type.h')
-rw-r--r--src/map_type.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map_type.h b/src/map_type.h
index 7098ad762..3c403c88b 100644
--- a/src/map_type.h
+++ b/src/map_type.h
@@ -50,6 +50,14 @@ struct TileIndexDiffC {
int16 y; ///< The y value of the coordinate
};
+/** Minimal and maximal map width and height */
+enum {
+ MIN_MAP_SIZE_BITS = 6, ///< Minimal size of map is equal to 2 ^ MIN_MAP_SIZE_BITS
+ MAX_MAP_SIZE_BITS = 11, ///< Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS
+ MIN_MAP_SIZE = 1 << MIN_MAP_SIZE_BITS, ///< Minimal map size = 64
+ MAX_MAP_SIZE = 1 << MAX_MAP_SIZE_BITS, ///< Maximal map size = 2048
+};
+
/**
* Approximation of the length of a straight track, relative to a diagonal
* track (ie the size of a tile side).