From a713a895a760f5f5053535a03d4ac179d6a1cf2f Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 16 Jun 2020 22:10:04 +0600 Subject: [PATCH] Get rid of color lookup, reverse red and green bits --- src/common/platform/posix/sdl/i_system.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index cfe6191ed0..df5ecd9a56 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -155,9 +155,9 @@ void I_PrintStr(const char *cp) if (s != 0) { // color HSVtoRGB(&r, &g, &b, h, 1, 1); - if (r == 1) attrib = 0x4; + if (r == 1) attrib = 0x1; if (g == 1) attrib |= 0x2; - if (b == 1) attrib |= 0x1; + if (b == 1) attrib |= 0x4; if (v > 0.6) attrib |= 0x8; } else @@ -166,8 +166,8 @@ void I_PrintStr(const char *cp) else if (v < 0.90) attrib = 0x7; else attrib = 0x15; } - static unsigned char cga_to_ansi[] = { 0, 4, 2, 6, 1, 5, 3, 7 }; - printData.AppendFormat("%c[%um",0x1B,((attrib & 0x8) ? 90 : 30) + (cga_to_ansi[attrib & 0x7])); + + printData.AppendFormat("%c[%um",0x1B,((attrib & 0x8) ? 90 : 30) + (attrib & 0x7)); } else printData.AppendFormat("%c[38;2;%u;%u;%um",27,color.r,color.g,color.b); }