summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-07-23 19:30:36 +0000
committertruelight <truelight@openttd.org>2007-07-23 19:30:36 +0000
commitb0d618c66b637b0b700159ffaef700d1c6a8c9fe (patch)
treebfad3a88dc72503d87b57da5c45379536699ab72 /src/smallmap_gui.cpp
parent33d78635efdc6458e72f96f33d169ec2e7e7cde6 (diff)
downloadopenttd-b0d618c66b637b0b700159ffaef700d1c6a8c9fe.tar.xz
(svn r10665) -Codechange: replace magic 15 with MAX_TILE_HEIGHT (bilbo)
-Codechange: replace magic 13 with MAX_SNOWLINE_HEIGHT (bilbo) -Codechange: assure _map_height_bits is always of correct size (Rubidium)
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r--src/smallmap_gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 12ebeeba0..3a80677c0 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -193,8 +193,10 @@ static inline void WRITE_PIXELS_OR(void *d, uint32 val)
#define MKCOLOR(x) TO_LE32X(x)
-/* Height encodings; 16 levels XXX - needs updating for more/finer heights! */
-static const uint32 _map_height_bits[16] = {
+/**
+ * Height encodings; MAX_TILE_HEIGHT + 1 levels, from 0 to MAX_TILE_HEIGHT
+ */
+static const uint32 _map_height_bits[] = {
MKCOLOR(0x5A5A5A5A),
MKCOLOR(0x5A5B5A5B),
MKCOLOR(0x5B5B5B5B),
@@ -212,6 +214,7 @@ static const uint32 _map_height_bits[16] = {
MKCOLOR(0x27272727),
MKCOLOR(0x27272727),
};
+assert_compile(lengthof(_map_height_bits) == MAX_TILE_HEIGHT + 1);
struct AndOr {
uint32 mor;