Merge branch 'crashlog_improvements' into jgrpp

This commit is contained in:
Jonathan G Rennison
2018-07-26 19:04:34 +01:00
7 changed files with 71 additions and 3 deletions

View File

@@ -133,7 +133,7 @@ void CDECL error(const char *s, ...)
abort();
}
void CDECL assert_msg_error(int line, const char *file, const char *expr, const char *str, ...)
void CDECL assert_msg_error(int line, const char *file, const char *expr, const char *extra, const char *str, ...)
{
va_list va;
char buf[2048];
@@ -141,6 +141,10 @@ void CDECL assert_msg_error(int line, const char *file, const char *expr, const
char *b = buf;
b += seprintf(b, lastof(buf), "Assertion failed at line %i of %s: %s\n\t", line, file, expr);
if (extra != nullptr) {
b += seprintf(b, lastof(buf), "%s\n\t", extra);
}
va_start(va, str);
vseprintf(b, lastof(buf), str, va);
va_end(va);
@@ -152,6 +156,12 @@ void CDECL assert_msg_error(int line, const char *file, const char *expr, const
abort();
}
const char *assert_tile_info(uint32 tile) {
static char buffer[128];
DumpTileInfo(buffer, lastof(buffer), tile);
return buffer;
}
/**
* Shows some information on the console/a popup box depending on the OS.
* @param str the text to show.