ref: 0bdbb4f6bb5d60f62beac4e581d5efa00d84667a
parent: 7c4a2b5caa3a74a6aa8b8ebc03a0c9fa428d4b2d
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Sep 10 11:38:32 EDT 2020
Made some message-printing code more consistent
--- a/src/Backends/Platform/GLFW3.cpp
+++ b/src/Backends/Platform/GLFW3.cpp
@@ -296,7 +296,7 @@
void Backend_ShowMessageBox(const char *title, const char *message)
{
// GLFW3 doesn't have a message box
- printf("ShowMessageBox - '%s' - '%s'\n", title, message);
+ Backend_PrintInfo("ShowMessageBox - '%s' - '%s'\n", title, message);
}
ATTRIBUTE_FORMAT_PRINTF(1, 2) void Backend_PrintError(const char *format, ...)
@@ -314,8 +314,8 @@
va_list argumentList;
va_start(argumentList, format);
fputs("INFO: ", stdout);
- vprintf(format, argumentList);
- putchar('\n');
+ vfprintf(stdout, format, argumentList);
+ fputc('\n', stdout);
va_end(argumentList);
}
--- a/src/Backends/Platform/SDL2.cpp
+++ b/src/Backends/Platform/SDL2.cpp
@@ -316,7 +316,7 @@
void Backend_ShowMessageBox(const char *title, const char *message)
{
- fprintf(stderr, "ShowMessageBox - '%s' - '%s'\n", title, message);
+ Backend_PrintInfo("ShowMessageBox - '%s' - '%s'\n", title, message);
if (SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, message, window) != 0)
Backend_PrintError("Was also unable to display a message box containing the error: %s", SDL_GetError());
@@ -337,8 +337,8 @@
va_list argumentList;
va_start(argumentList, format);
fputs("INFO: ", stdout);
- vprintf(format, argumentList);
- putchar('\n');
+ vfprintf(stdout, format, argumentList);
+ fputc('\n', stdout);
va_end(argumentList);
}