From bd5a7eb3a12088e64cfd445b5b80a3ffd5fe28e1 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 16 Aug 2006 07:17:21 +0000 Subject: [PATCH] changed several '^' checks to STRING_COLOR_TAG as they should be git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6559 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 2 +- clvm_cmds.c | 4 ++-- console.c | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 7c2b09bf..4a05b5d1 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -132,7 +132,7 @@ void SCR_DrawCenterString (void) if (start[l] == '\n' || !start[l]) break; // color codes add no visible characters, so don't count them - if (start[l] == '^' && (start[l+1] >= '0' && start[l+1] <= '9')) + if (start[l] == STRING_COLOR_TAG && (start[l+1] >= '0' && start[l+1] <= '9')) l++; else chars++; diff --git a/clvm_cmds.c b/clvm_cmds.c index 4a4dff9f..4bd60f2c 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -1269,7 +1269,7 @@ void VM_CL_registercmd (void) if(!Cmd_Exists(PRVM_G_STRING(OFS_PARM0))) { size_t alloclen; - + alloclen = strlen(PRVM_G_STRING(OFS_PARM0)) + 1; t = (char *)Z_Malloc(alloclen); memcpy(t, PRVM_G_STRING(OFS_PARM0), alloclen); @@ -2295,7 +2295,7 @@ static int Is_Text_Color (char c, char t) char c2 = c - (c & 128); char t2 = t - (t & 128); - if(c != '^' && c2 != '^') return 0; + if(c != STRING_COLOR_TAG && c2 != STRING_COLOR_TAG) return 0; if(t >= '0' && t <= '9') a = 1; if(t2 >= '0' && t2 <= '9') a = 1; /* if(t >= 'A' && t <= 'Z') a = 2; diff --git a/console.c b/console.c index 3d613a81..f6d40808 100644 --- a/console.c +++ b/console.c @@ -639,12 +639,12 @@ void Con_Print(const char *msg) { switch(*in) { - case '^': + case STRING_COLOR_TAG: switch(in[1]) { - case '^': + case STRING_COLOR_TAG: ++in; - *out++ = '^'; + *out++ = STRING_COLOR_TAG; break; case '0': case '7': @@ -698,7 +698,7 @@ void Con_Print(const char *msg) *out++ = 0x1B; *out++ = '['; *out++ = '0'; *out++ = ';'; *out++ = '1'; *out++ = 'm'; break; default: - *out++ = '^'; + *out++ = STRING_COLOR_TAG; break; } break; @@ -737,12 +737,12 @@ void Con_Print(const char *msg) { switch(*in) { - case '^': + case STRING_COLOR_TAG: switch(in[1]) { - case '^': + case STRING_COLOR_TAG: ++in; - *out++ = '^'; + *out++ = STRING_COLOR_TAG; break; case '0': case '1': @@ -757,7 +757,7 @@ void Con_Print(const char *msg) ++in; break; default: - *out++ = '^'; + *out++ = STRING_COLOR_TAG; break; } break; @@ -938,7 +938,7 @@ void Con_DrawNotify (void) // count up to the last non-whitespace, and ignore color codes for (j = 0;j < con_linewidth && text[j];j++) { - if (text[j] == '^' && (text[j+1] >= '0' && text[j+1] <= '9')) + if (text[j] == STRING_COLOR_TAG && (text[j+1] >= '0' && text[j+1] <= '9')) { j++; continue; -- 2.39.2