31 #ifdef NO_DEBUG_MESSAGES 32 #define DEBUG(name, level, ...) { } 39 #define DEBUG(name, level, ...) if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__) 41 extern int _debug_driver_level;
42 extern int _debug_grf_level;
43 extern int _debug_map_level;
44 extern int _debug_misc_level;
45 extern int _debug_net_level;
46 extern int _debug_sprite_level;
47 extern int _debug_oldloader_level;
48 extern int _debug_npf_level;
49 extern int _debug_yapf_level;
50 extern int _debug_freetype_level;
51 extern int _debug_script_level;
52 extern int _debug_sl_level;
53 extern int _debug_gamelog_level;
54 extern int _debug_desync_level;
55 extern int _debug_console_level;
57 extern int _debug_random_level;
60 void CDECL
debug(
const char *dbg,
const char *format, ...) WARN_FORMAT(2, 3);
68 #define FILE_LINE __FILE__, __LINE__ 92 uint64 _xxx_ = ottd_rdtsc();\ 93 static uint64 __sum__ = 0;\ 94 static uint32 __i__ = 0; 96 #define TOC(str, count)\ 97 __sum__ += ottd_rdtsc() - _xxx_;\ 98 if (++__i__ == count) {\ 99 DEBUG(misc, 0, "[%s] " OTTD_PRINTF64 " [avg: %.1f]", str, __sum__, __sum__/(double)__i__);\ 105 void ShowInfo(
const char *str);
106 void CDECL
ShowInfoF(
const char *str, ...) WARN_FORMAT(1, 2);
void CDECL const char * GetLogPrefix()
Get the prefix for logs; if show_date_in_logs is enabled it returns the date, otherwise it returns no...
void CDECL debug(const char *dbg, const char *format,...)
Output a debug line.
void CDECL ShowInfoF(const char *str,...)
Shows some information on the console/a popup box depending on the OS.
const char * GetDebugString()
Print out the current debug-level.
Functions related to CPU specific instructions.
void SetDebugString(const char *s)
Set debugging levels by parsing the text in s.
void CDECL char * DumpDebugFacilityNames(char *buf, char *last)
Dump the available debug facility names in the help text.
uint32 _realtime_tick
The real time in the game.