diff options
author | rubidium42 <rubidium@openttd.org> | 2021-06-12 21:33:01 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-06-13 15:25:31 +0200 |
commit | eb6cdadc4dad9de62abbd31c410050ae150935b1 (patch) | |
tree | 9abf6cf90bec474fcf226c15d6f85dbbbed04551 /src/console.cpp | |
parent | d9c1d18f2bde32fe615fbe6ad088fbce1e2b82bf (diff) | |
download | openttd-eb6cdadc4dad9de62abbd31c410050ae150935b1.tar.xz |
Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
Diffstat (limited to 'src/console.cpp')
-rw-r--r-- | src/console.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/console.cpp b/src/console.cpp index 90403b33f..dcc0725df 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -59,7 +59,7 @@ static void IConsoleWriteToLogFile(const char *string) fwrite("\n", 1, 1, _iconsole_output_file) != 1) { fclose(_iconsole_output_file); _iconsole_output_file = nullptr; - IConsolePrintF(CC_DEFAULT, "cannot write to log file"); + IConsolePrint(CC_ERROR, "Cannot write to console log file; closing the log file."); } } } @@ -67,7 +67,7 @@ static void IConsoleWriteToLogFile(const char *string) bool CloseConsoleLogIfActive() { if (_iconsole_output_file != nullptr) { - IConsolePrintF(CC_DEFAULT, "file output complete"); + IConsolePrint(CC_INFO, "Console log file closed."); fclose(_iconsole_output_file); _iconsole_output_file = nullptr; return true; @@ -126,25 +126,6 @@ void IConsolePrint(TextColour colour_code, const std::string &string) } /** - * Handle the printing of text entered into the console or redirected there - * by any other means. Uses printf() style format, for more information look - * at IConsolePrint() - */ -void CDECL IConsolePrintF(TextColour colour_code, const char *format, ...) -{ - assert(IsValidConsoleColour(colour_code)); - - va_list va; - char buf[ICON_MAX_STREAMSIZE]; - - va_start(va, format); - vseprintf(buf, lastof(buf), format, va); - va_end(va); - - IConsolePrint(colour_code, buf); -} - -/** * Change a string into its number representation. Supports * decimal and hexadecimal numbers as well as 'on'/'off' 'true'/'false' * @param *value the variable a successful conversion will be put in |