Use Str8 instead of const char * in termcolour functions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
#include "str8.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_WINDOWS
|
||||
|
||||
@@ -40,7 +41,7 @@ internal WORD colours[COUNT_TERM_COLOUR] = {
|
||||
[WAPP_TERM_COLOUR_FG_BR_WHITE] = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
|
||||
};
|
||||
|
||||
void print_coloured_text(const char *text, TerminalColour colour) {
|
||||
void print_coloured_text(Str8RO *text, TerminalColour colour) {
|
||||
persistent TermcolourData data = {0};
|
||||
if (data.handle == 0) {
|
||||
init_data(&data);
|
||||
@@ -53,7 +54,7 @@ void print_coloured_text(const char *text, TerminalColour colour) {
|
||||
}
|
||||
|
||||
SetConsoleTextAttribute(data.handle, data.current_colour);
|
||||
printf("%s", text);
|
||||
printf(WAPP_STR8_SPEC, wapp_str8_varg(text));
|
||||
}
|
||||
|
||||
internal void init_data(TermcolourData *data) {
|
||||
|
||||
Reference in New Issue
Block a user