debug.h
author Darkvater
Wed, 11 May 2005 00:00:27 +0000
changeset 1786 7cfd46c3fcc4
parent 1678 187385f01cc9
child 1847 d94ed71b61e7
permissions -rw-r--r--
(svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :)
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security". Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
1299
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     1
#ifndef DEBUG_H
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     2
#define DEBUG_H
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     3
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     4
#ifdef NO_DEBUG_MESSAGES
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     5
	#define DEBUG(name, level)
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     6
#else
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     7
	#define DEBUG(name, level) if (level == 0 || _debug_ ## name ## _level >= level) debug
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     8
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
     9
	extern int _debug_ai_level;
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    10
	extern int _debug_grf_level;
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    11
	extern int _debug_map_level;
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    12
	extern int _debug_misc_level;
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    13
	extern int _debug_ms_level;
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    14
	extern int _debug_net_level;
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    15
	extern int _debug_spritecache_level;
1322
a7fef520f54c (svn r1826) -Feature: a brand new OldLoader so OpenTTD is TTD(Patch) compatible
truelight
parents: 1299
diff changeset
    16
	extern int _debug_oldloader_level;
1678
187385f01cc9 (svn r2182) - Add: [NPF] There is now a debug class for NPF. Use -d npf<level> to enable debugging printouts from npf.
matthijs
parents: 1322
diff changeset
    17
	extern int _debug_npf_level;
1299
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    18
#endif
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    19
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    20
void CDECL debug(const char *s, ...);
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    21
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    22
void SetDebugString(const char *s);
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    23
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents:
diff changeset
    24
#endif