Changeset - r947:94f6b865b768
[Not reviewed]
master
0 2 0
darkvater - 19 years ago 2005-01-08 23:59:49
darkvater@openttd.org
(svn r1437) -Fix: Safetileadd preprocessor magic is the same as for GCC and no longer extern
2 files changed with 3 insertions and 7 deletions:
0 comments (0 inline, 0 general)
macros.h
Show inline comments
 
@@ -78,22 +78,18 @@ enum {
 
	CORRECT_Z_BITS = 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
 
};
 
#define CORRECT_Z(tileh) (CORRECT_Z_BITS & (1 << tileh))
 

	
 
#define TILE_ASSERT(x) assert( TILE_MASK(x) == (x) );
 

	
 
extern uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int line);
 
uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int line);
 

	
 
#if !defined(_DEBUG)
 
#	define TILE_ADD(x,y) ((x)+(y))
 
#else
 
#	if defined(__GNUC__)
 
#		define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ", " #y,  __FILE__, __LINE__))
 
#	else
 
#		define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ## ", " ## #y,  __FILE__, __LINE__))
 
#	endif
 
#	define TILE_ADD(x,y) (SafeTileAdd((x),(y), #x ", " #y,  __FILE__, __LINE__))
 
#endif
 

	
 
#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x,y))
 

	
 
//#define REMADP_COORDS(x,y,z) { int t = x; x = (y-t)*2; y+=t-z; }
 

	
misc.c
Show inline comments
 
@@ -727,13 +727,13 @@ int FindFirstBit(uint32 value)
 
	if (value & 0x0000000c) { value >>= 2;  i += 2; }
 
	if (value & 0x00000002) { i += 1; }
 
	return i;
 
}
 

	
 

	
 
extern uint SafeTileAdd(uint tile, int add, const char *exp, const char *file, int line)
 
uint SafeTileAdd(uint tile, int add, const char *exp, const char *file, int line)
 
{
 
	uint x = TileX(tile) + (signed char)(add & 0xFF);
 
	uint y = TileY(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);
 

	
 
	if (x >= MapSizeX() || y >= MapSizeY()) {
 
		char buf[512];
0 comments (0 inline, 0 general)