forked from mirror/OpenTTD
(svn r23) -Some omments on the code (blathijs)
This commit is contained in:
9
macros.h
9
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 */
|
||||
|
Reference in New Issue
Block a user