fix to sw colormaps (MSVC is stupid)
fixed clear command from crashing added ^h for toggleable half-alpha (still not rendered yet) added ^&?? for extended fg/bg colors: (poosibly temporary?) - first ? corresponds to foreground - second ? corresponds to background - valid characters for ? are 0-9, A-F and - - hexadecimal number represents a color from CGA RGBI colors - -(dash) represents default color for FG, clear for BG git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1838 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
4fa4d18341
commit
664467e41c
8 changed files with 241 additions and 6 deletions
|
@ -344,6 +344,28 @@ void Sys_Printf (char *fmt, ...)
|
|||
ext = q3codemasks[*str++-'0'] | (ext&~CON_Q3MASK); //change colour only.
|
||||
continue;
|
||||
}
|
||||
else if (*str == '&') // extended code
|
||||
{
|
||||
if (isextendedcode(*str+1) && isextendedcode(*str+2))
|
||||
{
|
||||
str++; // foreground char
|
||||
if (*str == '-') // default for FG
|
||||
ext = (COLOR_WHITE << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
else if (*str >= 'A')
|
||||
ext = ((*str - ('A' - 10)) << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
else
|
||||
ext = ((*str - '0') << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
str++; // background char
|
||||
if (*str == '-') // default (clear) for BG
|
||||
ext &= ~CON_BGMASK & ~CON_NONCLEARBG;
|
||||
else if (*str >= 'A')
|
||||
ext = ((*str - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
else
|
||||
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
continue;
|
||||
}
|
||||
str--; // else invalid code
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
str++;
|
||||
|
@ -356,6 +378,12 @@ void Sys_Printf (char *fmt, ...)
|
|||
ext ^= CON_BLINKTEXT;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 'h')
|
||||
{
|
||||
str++;
|
||||
ext ^= CON_HALFALPHA;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 's') //store on stack (it's great for names)
|
||||
{
|
||||
str++;
|
||||
|
|
|
@ -561,6 +561,28 @@ void Sys_Printf (char *fmt, ...)
|
|||
ext = q3codemasks[*str++-'0'] | (ext&~CON_Q3MASK); //change colour only.
|
||||
continue;
|
||||
}
|
||||
else if (*str == '&') // extended code
|
||||
{
|
||||
if (isextendedcode(*str+1) && isextendedcode(*str+2))
|
||||
{
|
||||
str++; // foreground char
|
||||
if (*str == '-') // default for FG
|
||||
ext = (COLOR_WHITE << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
else if (*str >= 'A')
|
||||
ext = ((*str - ('A' - 10)) << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
else
|
||||
ext = ((*str - '0') << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
str++; // background char
|
||||
if (*str == '-') // default (clear) for BG
|
||||
ext &= ~CON_BGMASK & ~CON_NONCLEARBG;
|
||||
else if (*str >= 'A')
|
||||
ext = ((*str - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
else
|
||||
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
continue;
|
||||
}
|
||||
str--; // else invalid code
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
str++;
|
||||
|
@ -573,6 +595,12 @@ void Sys_Printf (char *fmt, ...)
|
|||
ext ^= CON_BLINKTEXT;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 'h')
|
||||
{
|
||||
str++;
|
||||
ext ^= CON_HALFALPHA;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 's') //store on stack (it's great for names)
|
||||
{
|
||||
str++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue