try to fix extended character parsing some more

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2170 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-04-06 20:57:46 +00:00
parent b1eec3c095
commit bcb4f10991
4 changed files with 10 additions and 2 deletions

View file

@ -191,7 +191,6 @@ void CopyAndMarkup(conchar_t *dest, qbyte *src, int maxlength)
if (maxlength < 0)
return; // ...
maxlength--;
while(*src && maxlength>0)
{
if (*src == '^')
@ -220,9 +219,14 @@ void CopyAndMarkup(conchar_t *dest, qbyte *src, int maxlength)
ext = ((*src - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
else
ext = ((*src - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
src++;
continue;
}
src--; // else invalid code
// else invalid code
*dest++ = '^' | ext;
maxlength--;
if (maxlength <= 0)
break; // need an extra check for writing length
}
else if (*src == 'b') // toggle blink bit
{
@ -269,6 +273,7 @@ void CopyAndMarkup(conchar_t *dest, qbyte *src, int maxlength)
*dest++ = *src++;
else
*dest++ = *src++ | ext;
maxlength--;
}
*dest = 0;
}

View file

@ -143,6 +143,7 @@ void Draw_FunString(int x, int y, unsigned char *str)
ext = ((*str - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
else
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
str++;
continue;
}
// else invalid code

View file

@ -371,6 +371,7 @@ void Sys_Printf (char *fmt, ...)
ext = ((*str - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
else
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
str++;
continue;
}
Sys_PrintColouredChar('^' | ext);

View file

@ -579,6 +579,7 @@ void Sys_Printf (char *fmt, ...)
ext = ((*str - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
else
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
str++;
continue;
}
Sys_PrintColouredChar('^' | ext);