mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r19079) -Codechange: use _debug_console_level instead of _stdlib_con_developer
This commit is contained in:
parent
2fcab9d54e
commit
ac6ff0de9b
@ -33,7 +33,6 @@ IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
|
|||||||
|
|
||||||
/* ** stdlib ** */
|
/* ** stdlib ** */
|
||||||
byte _stdlib_developer = 1;
|
byte _stdlib_developer = 1;
|
||||||
bool _stdlib_con_developer = false;
|
|
||||||
FILE *_iconsole_output_file;
|
FILE *_iconsole_output_file;
|
||||||
|
|
||||||
void IConsoleInit()
|
void IConsoleInit()
|
||||||
@ -416,8 +415,7 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
|
|||||||
memset(&aliases, 0, sizeof(aliases));
|
memset(&aliases, 0, sizeof(aliases));
|
||||||
memset(&aliasstream, 0, sizeof(aliasstream));
|
memset(&aliasstream, 0, sizeof(aliasstream));
|
||||||
|
|
||||||
if (_stdlib_con_developer)
|
DEBUG(console, 6, "condbg: requested command is an alias; parsing...");
|
||||||
IConsolePrintF(CC_DEBUG, "condbg: requested command is an alias; parsing...");
|
|
||||||
|
|
||||||
aliases[0] = aliasstream;
|
aliases[0] = aliasstream;
|
||||||
for (cmdptr = alias->cmdline, a_index = 0, astream_i = 0; *cmdptr != '\0'; cmdptr++) {
|
for (cmdptr = alias->cmdline, a_index = 0, astream_i = 0; *cmdptr != '\0'; cmdptr++) {
|
||||||
@ -696,8 +694,7 @@ static void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token
|
|||||||
byte t_index = tokencount;
|
byte t_index = tokencount;
|
||||||
uint32 value;
|
uint32 value;
|
||||||
|
|
||||||
if (_stdlib_con_developer)
|
DEBUG(console, 6, "Requested command is a variable");
|
||||||
IConsolePrintF(CC_DEBUG, "condbg: requested command is a variable");
|
|
||||||
|
|
||||||
if (tokencount == 0) { // Just print out value
|
if (tokencount == 0) { // Just print out value
|
||||||
IConsoleVarPrintGetValue(var);
|
IConsoleVarPrintGetValue(var);
|
||||||
@ -779,8 +776,7 @@ void IConsoleCmdExec(const char *cmdstr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_stdlib_con_developer)
|
DEBUG(console, 4, "Executing cmdline: '%s'", cmdstr);
|
||||||
IConsolePrintF(CC_DEBUG, "condbg: executing cmdline: '%s'", cmdstr);
|
|
||||||
|
|
||||||
memset(&tokens, 0, sizeof(tokens));
|
memset(&tokens, 0, sizeof(tokens));
|
||||||
memset(&tokenstream, 0, sizeof(tokenstream));
|
memset(&tokenstream, 0, sizeof(tokenstream));
|
||||||
@ -824,12 +820,8 @@ void IConsoleCmdExec(const char *cmdstr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_stdlib_con_developer) {
|
for (uint i = 0; tokens[i] != NULL; i++) {
|
||||||
uint i;
|
DEBUG(console, 8, "condbg: token %d is: '%s'", i, tokens[i]);
|
||||||
|
|
||||||
for (i = 0; tokens[i] != NULL; i++) {
|
|
||||||
IConsolePrintF(CC_DEBUG, "condbg: token %d is: '%s'", i, tokens[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tokens[0] == '\0') return; // don't execute empty commands
|
if (tokens[0] == '\0') return; // don't execute empty commands
|
||||||
|
@ -1766,10 +1766,6 @@ DEF_CONSOLE_CMD(ConGamelogPrint)
|
|||||||
|
|
||||||
static void IConsoleDebugLibRegister()
|
static void IConsoleDebugLibRegister()
|
||||||
{
|
{
|
||||||
/* debugging variables and functions */
|
|
||||||
extern bool _stdlib_con_developer; // XXX extern in .cpp
|
|
||||||
|
|
||||||
IConsoleVarRegister("con_developer", &_stdlib_con_developer, ICONSOLE_VAR_BOOLEAN, "Enable/disable console debugging information (internal)");
|
|
||||||
IConsoleCmdRegister("resettile", ConResetTile);
|
IConsoleCmdRegister("resettile", ConResetTile);
|
||||||
IConsoleCmdRegister("stopall", ConStopAllVehicles);
|
IConsoleCmdRegister("stopall", ConStopAllVehicles);
|
||||||
IConsoleAliasRegister("dbg_echo", "echo %A; echo %B");
|
IConsoleAliasRegister("dbg_echo", "echo %A; echo %B");
|
||||||
|
@ -40,6 +40,7 @@ int _debug_freetype_level;
|
|||||||
int _debug_sl_level;
|
int _debug_sl_level;
|
||||||
int _debug_gamelog_level;
|
int _debug_gamelog_level;
|
||||||
int _debug_desync_level;
|
int _debug_desync_level;
|
||||||
|
int _debug_console_level;
|
||||||
|
|
||||||
|
|
||||||
struct DebugLevel {
|
struct DebugLevel {
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
extern int _debug_sl_level;
|
extern int _debug_sl_level;
|
||||||
extern int _debug_gamelog_level;
|
extern int _debug_gamelog_level;
|
||||||
extern int _debug_desync_level;
|
extern int _debug_desync_level;
|
||||||
|
extern int _debug_console_level;
|
||||||
|
|
||||||
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
|
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
|
||||||
#endif /* NO_DEBUG_MESSAGES */
|
#endif /* NO_DEBUG_MESSAGES */
|
||||||
|
Loading…
Reference in New Issue
Block a user