Made some message-printing code more consistent

This commit is contained in:
Clownacy 2020-09-10 15:38:32 +01:00
parent 7c4a2b5caa
commit 0bdbb4f6bb
2 changed files with 6 additions and 6 deletions

View file

@ -296,7 +296,7 @@ void Backend_GetKeyboardState(bool *out_keyboard_state)
void Backend_ShowMessageBox(const char *title, const char *message) void Backend_ShowMessageBox(const char *title, const char *message)
{ {
// GLFW3 doesn't have a message box // 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, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2) void Backend_PrintError(const char *format, ...)
@ -314,8 +314,8 @@ ATTRIBUTE_FORMAT_PRINTF(1, 2) void Backend_PrintInfo(const char *format, ...)
va_list argumentList; va_list argumentList;
va_start(argumentList, format); va_start(argumentList, format);
fputs("INFO: ", stdout); fputs("INFO: ", stdout);
vprintf(format, argumentList); vfprintf(stdout, format, argumentList);
putchar('\n'); fputc('\n', stdout);
va_end(argumentList); va_end(argumentList);
} }

View file

@ -316,7 +316,7 @@ void Backend_GetKeyboardState(bool *out_keyboard_state)
void Backend_ShowMessageBox(const char *title, const char *message) 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) 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()); Backend_PrintError("Was also unable to display a message box containing the error: %s", SDL_GetError());
@ -337,8 +337,8 @@ ATTRIBUTE_FORMAT_PRINTF(1, 2) void Backend_PrintInfo(const char *format, ...)
va_list argumentList; va_list argumentList;
va_start(argumentList, format); va_start(argumentList, format);
fputs("INFO: ", stdout); fputs("INFO: ", stdout);
vprintf(format, argumentList); vfprintf(stdout, format, argumentList);
putchar('\n'); fputc('\n', stdout);
va_end(argumentList); va_end(argumentList);
} }