summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-21 22:15:02 +0000
committertron <tron@openttd.org>2005-07-21 22:15:02 +0000
commit0762aa9ec950a7c7966b1706daa7a032f5de790a (patch)
tree0e2d2d052ab58755549ef42d694f58679a4c496c /macros.h
parenta446294e7cdbcf71ffe2052a4a9954dc46a64133 (diff)
downloadopenttd-0762aa9ec950a7c7966b1706daa7a032f5de790a.tar.xz
(svn r2669) Shuffle some more stuff around to reduce dependencies
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/macros.h b/macros.h
index 28b61c308..460360e7f 100644
--- a/macros.h
+++ b/macros.h
@@ -110,17 +110,6 @@ static inline int KillFirstBit2x64(int value)
#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
-#define BEGIN_TILE_LOOP(var,w,h,tile) \
- {int h_cur = h; \
- uint var = tile; \
- do { \
- int w_cur = w; \
- do {
-
-#define END_TILE_LOOP(var,w,h,tile) \
- } while (++var, --w_cur != 0); \
- } while (var += TileDiffXY(0, 1) - (w), --h_cur != 0);}
-
#define for_each_bit(_i,_b) \
for(_i=0; _b!=0; _i++,_b>>=1) \
@@ -165,4 +154,10 @@ static inline void swap_tile(TileIndex *a, TileIndex *b) { TileIndex t = *a; *a
#define ROL(x, n) ((x) << (n) | (x) >> (sizeof(x) * 8 - (n)))
#define ROR(x, n) ((x) >> (n) | (x) << (sizeof(x) * 8 - (n)))
+/* IS_INT_INSIDE = filter for ascii-function codes like BELL and so on [we need an special filter here later] */
+static inline bool IsValidAsciiChar(byte key)
+{
+ return IS_INT_INSIDE(key, ' ', 256);
+}
+
#endif /* MACROS_H */