From 4587ede35d8ada9f15c1a8ba5e2362cc870c0073 Mon Sep 17 00:00:00 2001 From: darkvater Date: Mon, 16 Aug 2004 15:13:46 +0000 Subject: [PATCH] (svn r67) -Forget to change debug message for grfspecial.c -Added compile flag NO_DEBUG_MESSAGES which will strip executeable of all DEBUG(..,..)'s --- grfspecial.c | 3 +-- misc_gui.c | 2 -- variables.h | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/grfspecial.c b/grfspecial.c index 47f7bc31cb..d91711b040 100644 --- a/grfspecial.c +++ b/grfspecial.c @@ -928,8 +928,7 @@ static void GRFInfo(byte *buf, int len) uint8 version = buf[1]; // this is de facto big endian - grf_load_dword() unsuitable uint32 grfid = buf[2] << 24 | buf[3] << 16 | buf[4] << 8 | buf[5]; - if(_debug_misc_level!=0) - printf("[%s] Loaded GRFv%d set %08lx - %s:\n%s\n", _cur_grffile, version, grfid, buf+6, buf+6+strlen(buf+6)+1); + DEBUG(grf, 1) ("[%s] Loaded GRFv%d set %08lx - %s:\n%s\n", _cur_grffile, version, grfid, buf+6, buf+6+strlen(buf+6)+1); } } diff --git a/misc_gui.c b/misc_gui.c index 755ca0c794..2d54d1e999 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -150,7 +150,6 @@ static void Place_LandInfo(uint tile) GetTileDesc(tile, &lid.td); #if defined(_DEBUG) - { DEBUG(misc, 0) ("TILE: %#x (%i,%i)", tile, GET_TILE_X(tile), GET_TILE_Y(tile)); DEBUG(misc, 0) ("_map_type_and_height=%#x", _map_type_and_height[tile]); DEBUG(misc, 0) ("_map2=%#x", _map2[tile]); @@ -158,7 +157,6 @@ static void Place_LandInfo(uint tile) DEBUG(misc, 0) ("_map3_hi=%#x", _map3_hi[tile]); DEBUG(misc, 0) ("_map5=%#x", _map5[tile]); DEBUG(misc, 0) ("_map_owner=%#x", _map_owner[tile]); - } #endif } diff --git a/variables.h b/variables.h index a992b1e126..d7ee687130 100644 --- a/variables.h +++ b/variables.h @@ -429,6 +429,10 @@ VARDEF int _debug_misc_level; VARDEF int _debug_grf_level; void CDECL debug(const char *s, ...); -#define DEBUG(name, level) if (level == 0 || _debug_ ## name ## _level >= level) debug +#ifdef NO_DEBUG_MESSAGES + #define DEBUG(name, level) +#else + #define DEBUG(name, level) if (level == 0 || _debug_ ## name ## _level >= level) debug +#endif #endif /* VARIABLES_H */