Add WHBLogConsoleSetColor (#138)

This commit is contained in:
GaryOderNichts 2020-05-26 01:03:19 +02:00 committed by GitHub
parent 05e45cc180
commit 27fbfd55fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -19,6 +19,9 @@ WHBLogConsoleInit();
void
WHBLogConsoleFree();
void
WHBLogConsoleSetColor(uint32_t color);
void
WHBLogConsoleDraw();

View File

@ -19,6 +19,7 @@ static int sLineNum = 0;
static void *sBufferTV = NULL, *sBufferDRC = NULL;
static uint32_t sBufferSizeTV = 0, sBufferSizeDRC = 0;
static BOOL sConsoleHasForeground = TRUE;
static uint32_t consoleColor = 0x993333FF;
static void
ConsoleAddLine(const char *line)
@ -96,6 +97,12 @@ WHBLogConsoleFree()
}
}
void
WHBLogConsoleSetColor(uint32_t color)
{
consoleColor = color;
}
void
WHBLogConsoleDraw()
{
@ -103,8 +110,8 @@ WHBLogConsoleDraw()
return;
}
OSScreenClearBufferEx(SCREEN_TV, 0x993333FF);
OSScreenClearBufferEx(SCREEN_DRC, 0x993333FF);
OSScreenClearBufferEx(SCREEN_TV, consoleColor);
OSScreenClearBufferEx(SCREEN_DRC, consoleColor);
for (int y = 0; y < NUM_LINES; ++y) {
OSScreenPutFontEx(SCREEN_TV, 0, y, sConsoleBuffer[y]);