summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-08-11 22:07:08 +0000
committerdarkvater <darkvater@openttd.org>2004-08-11 22:07:08 +0000
commitf42201496093f04220e58b1c4cd4d69531839de4 (patch)
treebbd3f2f0084e8bba00dd232cb07236b5bebd9d6a /macros.h
parent6679afc48a1bec985b6687dee105730b89682224 (diff)
downloadopenttd-f42201496093f04220e58b1c4cd4d69531839de4.tar.xz
(svn r23) -Some omments on the code (blathijs)
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index 0574520ef..bd89d6803 100644
--- a/macros.h
+++ b/macros.h
@@ -130,7 +130,14 @@ extern uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int
#define SPRITE_PALETTE(x) ((x) + 0x8000)
extern const byte _ffb_64[128];
+/* Returns the position of the first bit that is not zero, counted from the
+ * left. Ie, 10110100 returns 2, 00000001 returns 0, etc. When x == 0 returns
+ * 0.
+ */
#define FIND_FIRST_BIT(x) _ffb_64[(x)]
+/* Returns x with the first bit that is not zero, counted from the left, set
+ * to zero. So, 10110100 returns 10110000, 00000001 returns 00000000, etc.
+ */
#define KILL_FIRST_BIT(x) _ffb_64[(x)+64]
static INLINE int FindFirstBit2x64(int value)
@@ -212,4 +219,6 @@ static INLINE void WRITE_LE_UINT16(const void *b, uint16 x) {
((byte*)b)[1] = (byte)(x >> 8);
}
+#define MAX_DETOUR 6
+
#endif /* MACROS_H */