mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-13 15:31:09 +00:00
Keep color across wrapped lines
And this works by inserting the same color code on each wrapped line.
This commit is contained in:
parent
587586f4bb
commit
b9b36a44a8
1 changed files with 11 additions and 5 deletions
|
@ -1106,6 +1106,7 @@ static void CON_Print(char *msg)
|
||||||
{
|
{
|
||||||
size_t l;
|
size_t l;
|
||||||
INT32 controlchars = 0; // for color changing
|
INT32 controlchars = 0; // for color changing
|
||||||
|
char color = '\x80'; // keep color across lines
|
||||||
|
|
||||||
if (msg == NULL)
|
if (msg == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -1131,7 +1132,7 @@ static void CON_Print(char *msg)
|
||||||
{
|
{
|
||||||
if (*msg & 0x80)
|
if (*msg & 0x80)
|
||||||
{
|
{
|
||||||
con_line[con_cx++] = *(msg++);
|
color = con_line[con_cx++] = *(msg++);
|
||||||
controlchars++;
|
controlchars++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1139,12 +1140,14 @@ static void CON_Print(char *msg)
|
||||||
{
|
{
|
||||||
con_cy--;
|
con_cy--;
|
||||||
CON_Linefeed();
|
CON_Linefeed();
|
||||||
|
color = '\x80';
|
||||||
controlchars = 0;
|
controlchars = 0;
|
||||||
}
|
}
|
||||||
else if (*msg == '\n') // linefeed
|
else if (*msg == '\n') // linefeed
|
||||||
{
|
{
|
||||||
CON_Linefeed();
|
CON_Linefeed();
|
||||||
controlchars = 0;
|
con_line[con_cx++] = color;
|
||||||
|
controlchars = 1;
|
||||||
}
|
}
|
||||||
else if (*msg == ' ') // space
|
else if (*msg == ' ') // space
|
||||||
{
|
{
|
||||||
|
@ -1152,7 +1155,8 @@ static void CON_Print(char *msg)
|
||||||
if (con_cx - controlchars >= con_width-11)
|
if (con_cx - controlchars >= con_width-11)
|
||||||
{
|
{
|
||||||
CON_Linefeed();
|
CON_Linefeed();
|
||||||
controlchars = 0;
|
con_line[con_cx++] = color;
|
||||||
|
controlchars = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (*msg == '\t')
|
else if (*msg == '\t')
|
||||||
|
@ -1167,7 +1171,8 @@ static void CON_Print(char *msg)
|
||||||
if (con_cx - controlchars >= con_width-11)
|
if (con_cx - controlchars >= con_width-11)
|
||||||
{
|
{
|
||||||
CON_Linefeed();
|
CON_Linefeed();
|
||||||
controlchars = 0;
|
con_line[con_cx++] = color;
|
||||||
|
controlchars = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg++;
|
msg++;
|
||||||
|
@ -1184,7 +1189,8 @@ static void CON_Print(char *msg)
|
||||||
if ((con_cx - controlchars) + l > con_width-11)
|
if ((con_cx - controlchars) + l > con_width-11)
|
||||||
{
|
{
|
||||||
CON_Linefeed();
|
CON_Linefeed();
|
||||||
controlchars = 0;
|
con_line[con_cx++] = color;
|
||||||
|
controlchars = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// a word at a time
|
// a word at a time
|
||||||
|
|
Loading…
Reference in a new issue