mirror of https://github.com/OpenTTD/OpenTTD
(svn r24099) -Add: Output list of -d option facilities with in the help text.
parent
fd2900f863
commit
b57bef91a1
|
@ -73,6 +73,31 @@ struct DebugLevel {
|
||||||
};
|
};
|
||||||
#undef DEBUG_LEVEL
|
#undef DEBUG_LEVEL
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dump the available debug facility names in the help text.
|
||||||
|
* @param buf Start address for storing the output.
|
||||||
|
* @param last Last valid address for storing the output.
|
||||||
|
* @return Next free position in the output.
|
||||||
|
*/
|
||||||
|
char *DumpDebugFacilityNames(char *buf, char *last)
|
||||||
|
{
|
||||||
|
int length = 0;
|
||||||
|
for (const DebugLevel *i = debug_level; i != endof(debug_level); ++i) {
|
||||||
|
if (length == 0) {
|
||||||
|
buf = strecpy(buf, "List of debug facility names:\n", last);
|
||||||
|
} else {
|
||||||
|
buf = strecpy(buf, ", ", last);
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
buf = strecpy(buf, i->name, last);
|
||||||
|
length += strlen(i->name);
|
||||||
|
}
|
||||||
|
if (length > 0) {
|
||||||
|
buf = strecpy(buf, "\n\n", last);
|
||||||
|
}
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(NO_DEBUG_MESSAGES)
|
#if !defined(NO_DEBUG_MESSAGES)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
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 */
|
||||||
|
|
||||||
|
char *DumpDebugFacilityNames(char *buf, char *last);
|
||||||
void SetDebugString(const char *s);
|
void SetDebugString(const char *s);
|
||||||
const char *GetDebugString();
|
const char *GetDebugString();
|
||||||
|
|
||||||
|
|
|
@ -192,6 +192,9 @@ static void ShowHelp()
|
||||||
/* List the blitters */
|
/* List the blitters */
|
||||||
p = BlitterFactoryBase::GetBlittersInfo(p, lastof(buf));
|
p = BlitterFactoryBase::GetBlittersInfo(p, lastof(buf));
|
||||||
|
|
||||||
|
/* List the debug facilities. */
|
||||||
|
p = DumpDebugFacilityNames(p, lastof(buf));
|
||||||
|
|
||||||
/* We need to initialize the AI, so it finds the AIs */
|
/* We need to initialize the AI, so it finds the AIs */
|
||||||
AI::Initialize();
|
AI::Initialize();
|
||||||
p = AI::GetConsoleList(p, lastof(buf), true);
|
p = AI::GetConsoleList(p, lastof(buf), true);
|
||||||
|
|
Loading…
Reference in New Issue